diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ee5385 --- /dev/null +++ b/.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/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.CheshireCatApi/.idea/.gitignore b/.idea/.idea.CheshireCatApi/.idea/.gitignore new file mode 100644 index 0000000..aea0ef4 --- /dev/null +++ b/.idea/.idea.CheshireCatApi/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/projectSettingsUpdater.xml +/modules.xml +/contentModel.xml +/.idea.CheshireCatApi.iml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.CheshireCatApi/.idea/.name b/.idea/.idea.CheshireCatApi/.idea/.name new file mode 100644 index 0000000..90d0ef7 --- /dev/null +++ b/.idea/.idea.CheshireCatApi/.idea/.name @@ -0,0 +1 @@ +CheshireCatApi \ No newline at end of file diff --git a/.idea/.idea.CheshireCatApi/.idea/indexLayout.xml b/.idea/.idea.CheshireCatApi/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.CheshireCatApi/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/api-client-csharp.iml b/.idea/api-client-csharp.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/api-client-csharp.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..dc3e2b1 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,58 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..ff70cf5 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..954cf05 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/.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/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..fa0e547 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,125 @@ +.gitignore +.openapi-generator-ignore +CheshireCatApi.sln +README.md +api/openapi.yaml +appveyor.yml +docs/BodyUploadUrl.md +docs/Collection.md +docs/CollectionData.md +docs/CollectionsList.md +docs/ConversationHistory.md +docs/ConversationMessage.md +docs/Detail.md +docs/EmbedderApi.md +docs/FileResponse.md +docs/Filters.md +docs/GetPluginSettings200Response.md +docs/HTTPValidationError.md +docs/HooksInner.md +docs/LargeLanguageModelApi.md +docs/MemoryApi.md +docs/MemoryRecall.md +docs/MetaData.md +docs/Plugin.md +docs/PluginsApi.md +docs/PluginsList.md +docs/QueryData.md +docs/RabbitHoleApi.md +docs/ResponseGetAllowedMimetypes.md +docs/Setting.md +docs/SettingBody.md +docs/SettingsApi.md +docs/SettingsResponse.md +docs/Status.md +docs/StatusApi.md +docs/ToggleResponse.md +docs/ToolsInner.md +docs/VectorsData.md +docs/WebResponse.md +git_push.sh +src/CheshireCatApi.Test/Api/EmbedderApiTests.cs +src/CheshireCatApi.Test/Api/LargeLanguageModelApiTests.cs +src/CheshireCatApi.Test/Api/MemoryApiTests.cs +src/CheshireCatApi.Test/Api/PluginsApiTests.cs +src/CheshireCatApi.Test/Api/RabbitHoleApiTests.cs +src/CheshireCatApi.Test/Api/SettingsApiTests.cs +src/CheshireCatApi.Test/Api/StatusApiTests.cs +src/CheshireCatApi.Test/CheshireCatApi.Test.csproj +src/CheshireCatApi.Test/Model/BodyUploadUrlTests.cs +src/CheshireCatApi.Test/Model/CollectionDataTests.cs +src/CheshireCatApi.Test/Model/CollectionTests.cs +src/CheshireCatApi.Test/Model/CollectionsListTests.cs +src/CheshireCatApi.Test/Model/ConversationHistoryTests.cs +src/CheshireCatApi.Test/Model/ConversationMessageTests.cs +src/CheshireCatApi.Test/Model/DetailTests.cs +src/CheshireCatApi.Test/Model/FileResponseTests.cs +src/CheshireCatApi.Test/Model/FiltersTests.cs +src/CheshireCatApi.Test/Model/GetPluginSettings200ResponseTests.cs +src/CheshireCatApi.Test/Model/HTTPValidationErrorTests.cs +src/CheshireCatApi.Test/Model/HooksInnerTests.cs +src/CheshireCatApi.Test/Model/MemoryRecallTests.cs +src/CheshireCatApi.Test/Model/MetaDataTests.cs +src/CheshireCatApi.Test/Model/PluginTests.cs +src/CheshireCatApi.Test/Model/PluginsListTests.cs +src/CheshireCatApi.Test/Model/QueryDataTests.cs +src/CheshireCatApi.Test/Model/ResponseGetAllowedMimetypesTests.cs +src/CheshireCatApi.Test/Model/SettingBodyTests.cs +src/CheshireCatApi.Test/Model/SettingTests.cs +src/CheshireCatApi.Test/Model/SettingsResponseTests.cs +src/CheshireCatApi.Test/Model/StatusTests.cs +src/CheshireCatApi.Test/Model/ToggleResponseTests.cs +src/CheshireCatApi.Test/Model/ToolsInnerTests.cs +src/CheshireCatApi.Test/Model/VectorsDataTests.cs +src/CheshireCatApi.Test/Model/WebResponseTests.cs +src/CheshireCatApi/Api/EmbedderApi.cs +src/CheshireCatApi/Api/LargeLanguageModelApi.cs +src/CheshireCatApi/Api/MemoryApi.cs +src/CheshireCatApi/Api/PluginsApi.cs +src/CheshireCatApi/Api/RabbitHoleApi.cs +src/CheshireCatApi/Api/SettingsApi.cs +src/CheshireCatApi/Api/StatusApi.cs +src/CheshireCatApi/CheshireCatApi.csproj +src/CheshireCatApi/Client/ApiClient.cs +src/CheshireCatApi/Client/ApiException.cs +src/CheshireCatApi/Client/ApiResponse.cs +src/CheshireCatApi/Client/ClientUtils.cs +src/CheshireCatApi/Client/Configuration.cs +src/CheshireCatApi/Client/ExceptionFactory.cs +src/CheshireCatApi/Client/GlobalConfiguration.cs +src/CheshireCatApi/Client/HttpMethod.cs +src/CheshireCatApi/Client/IApiAccessor.cs +src/CheshireCatApi/Client/IAsynchronousClient.cs +src/CheshireCatApi/Client/IReadableConfiguration.cs +src/CheshireCatApi/Client/ISynchronousClient.cs +src/CheshireCatApi/Client/Multimap.cs +src/CheshireCatApi/Client/OpenAPIDateConverter.cs +src/CheshireCatApi/Client/RequestOptions.cs +src/CheshireCatApi/Client/RetryConfiguration.cs +src/CheshireCatApi/Model/AbstractOpenAPISchema.cs +src/CheshireCatApi/Model/BodyUploadUrl.cs +src/CheshireCatApi/Model/Collection.cs +src/CheshireCatApi/Model/CollectionData.cs +src/CheshireCatApi/Model/CollectionsList.cs +src/CheshireCatApi/Model/ConversationHistory.cs +src/CheshireCatApi/Model/ConversationMessage.cs +src/CheshireCatApi/Model/Detail.cs +src/CheshireCatApi/Model/FileResponse.cs +src/CheshireCatApi/Model/Filters.cs +src/CheshireCatApi/Model/GetPluginSettings200Response.cs +src/CheshireCatApi/Model/HTTPValidationError.cs +src/CheshireCatApi/Model/HooksInner.cs +src/CheshireCatApi/Model/MemoryRecall.cs +src/CheshireCatApi/Model/MetaData.cs +src/CheshireCatApi/Model/Plugin.cs +src/CheshireCatApi/Model/PluginsList.cs +src/CheshireCatApi/Model/QueryData.cs +src/CheshireCatApi/Model/ResponseGetAllowedMimetypes.cs +src/CheshireCatApi/Model/Setting.cs +src/CheshireCatApi/Model/SettingBody.cs +src/CheshireCatApi/Model/SettingsResponse.cs +src/CheshireCatApi/Model/Status.cs +src/CheshireCatApi/Model/ToggleResponse.cs +src/CheshireCatApi/Model/ToolsInner.cs +src/CheshireCatApi/Model/VectorsData.cs +src/CheshireCatApi/Model/WebResponse.cs diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..c9e125b --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.4.0-SNAPSHOT diff --git a/CheshireCatApi.sln b/CheshireCatApi.sln new file mode 100644 index 0000000..e38918e --- /dev/null +++ b/CheshireCatApi.sln @@ -0,0 +1,33 @@ +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}") = "CheshireCatApi", "src\CheshireCatApi\CheshireCatApi.csproj", "{B8CE0940-8FF3-48A5-B2E6-25423D09E3F1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CheshireCatApi.Test", "src\CheshireCatApi.Test\CheshireCatApi.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestClient", "TestClient\TestClient.csproj", "{830B558E-90B8-46D4-90B1-436F246D73B0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B8CE0940-8FF3-48A5-B2E6-25423D09E3F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B8CE0940-8FF3-48A5-B2E6-25423D09E3F1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B8CE0940-8FF3-48A5-B2E6-25423D09E3F1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B8CE0940-8FF3-48A5-B2E6-25423D09E3F1}.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 + {830B558E-90B8-46D4-90B1-436F246D73B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {830B558E-90B8-46D4-90B1-436F246D73B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {830B558E-90B8-46D4-90B1-436F246D73B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {830B558E-90B8-46D4-90B1-436F246D73B0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/README.md b/README.md new file mode 100644 index 0000000..205ef1d --- /dev/null +++ b/README.md @@ -0,0 +1,186 @@ +# CheshireCatApi - the C# library for the 😸 Cheshire-Cat API + +Customizable AI architecture + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.0.5 +- SDK version: 1.0.0 +- 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 CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.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 CheshireCatApi.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 CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class Example + { + public static void Main() + { + + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new EmbedderApi(config); + var languageEmbedderName = "languageEmbedderName_example"; // string | + + try + { + // Get Embedder Settings + Setting result = apiInstance.GetEmbedderSettings(languageEmbedderName); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling EmbedderApi.GetEmbedderSettings: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*EmbedderApi* | [**GetEmbedderSettings**](docs/EmbedderApi.md#getembeddersettings) | **GET** /embedder/settings/{languageEmbedderName} | Get Embedder Settings +*EmbedderApi* | [**GetEmbeddersSettings**](docs/EmbedderApi.md#getembedderssettings) | **GET** /embedder/settings | Get Embedders Settings +*EmbedderApi* | [**UpsertEmbedderSetting**](docs/EmbedderApi.md#upsertembeddersetting) | **PUT** /embedder/settings/{languageEmbedderName} | Upsert Embedder Setting +*LargeLanguageModelApi* | [**GetLlmSettings**](docs/LargeLanguageModelApi.md#getllmsettings) | **GET** /llm/settings/{languageModelName} | Get Llm Settings +*LargeLanguageModelApi* | [**GetLlmsSettings**](docs/LargeLanguageModelApi.md#getllmssettings) | **GET** /llm/settings | Get LLMs Settings +*LargeLanguageModelApi* | [**UpsertLlmSetting**](docs/LargeLanguageModelApi.md#upsertllmsetting) | **PUT** /llm/settings/{languageModelName} | Upsert LLM Setting +*MemoryApi* | [**DeletePointInMemory**](docs/MemoryApi.md#deletepointinmemory) | **DELETE** /memory/collections/{collection_id}/points/{memory_id} | Delete Point In Memory +*MemoryApi* | [**GetCollections**](docs/MemoryApi.md#getcollections) | **GET** /memory/collections | Get Collections +*MemoryApi* | [**GetConversationHistory**](docs/MemoryApi.md#getconversationhistory) | **GET** /memory/conversation_history | Get Conversation History +*MemoryApi* | [**RecallMemoriesFromText**](docs/MemoryApi.md#recallmemoriesfromtext) | **GET** /memory/recall | Recall Memories From Text +*MemoryApi* | [**WipeCollections**](docs/MemoryApi.md#wipecollections) | **DELETE** /memory/collections | Wipe Collections +*MemoryApi* | [**WipeConversationHistory**](docs/MemoryApi.md#wipeconversationhistory) | **DELETE** /memory/conversation_history | Wipe Conversation History +*MemoryApi* | [**WipeMemoryPoints**](docs/MemoryApi.md#wipememorypoints) | **DELETE** /memory/collections/{collection_id}/points | Wipe Memory Points By Metadata +*MemoryApi* | [**WipeSingleCollection**](docs/MemoryApi.md#wipesinglecollection) | **DELETE** /memory/collections/{collection_id} | Wipe Single Collection +*PluginsApi* | [**DeletePlugin**](docs/PluginsApi.md#deleteplugin) | **DELETE** /plugins/{plugin_id} | Delete Plugin +*PluginsApi* | [**GetPluginDetails**](docs/PluginsApi.md#getplugindetails) | **GET** /plugins/{plugin_id} | Get Plugin Details +*PluginsApi* | [**GetPluginSettings**](docs/PluginsApi.md#getpluginsettings) | **GET** /plugins/settings/{plugin_id} | Get Plugin Settings +*PluginsApi* | [**GetPluginsSettings**](docs/PluginsApi.md#getpluginssettings) | **GET** /plugins/settings | Get Plugins Settings +*PluginsApi* | [**InstallPlugin**](docs/PluginsApi.md#installplugin) | **POST** /plugins/upload | Install Plugin +*PluginsApi* | [**InstallPluginFromRegistry**](docs/PluginsApi.md#installpluginfromregistry) | **POST** /plugins/upload/registry | Install Plugin From Registry +*PluginsApi* | [**ListAvailablePlugins**](docs/PluginsApi.md#listavailableplugins) | **GET** /plugins | List Available Plugins +*PluginsApi* | [**TogglePlugin**](docs/PluginsApi.md#toggleplugin) | **PUT** /plugins/toggle/{plugin_id} | Toggle Plugin +*PluginsApi* | [**UpsertPluginSettings**](docs/PluginsApi.md#upsertpluginsettings) | **PUT** /plugins/settings/{plugin_id} | Upsert Plugin Settings +*RabbitHoleApi* | [**GetAllowedMimetypes**](docs/RabbitHoleApi.md#getallowedmimetypes) | **GET** /rabbithole/allowed-mimetypes | Get Allowed Mimetypes +*RabbitHoleApi* | [**UploadFile**](docs/RabbitHoleApi.md#uploadfile) | **POST** /rabbithole | Upload File +*RabbitHoleApi* | [**UploadMemory**](docs/RabbitHoleApi.md#uploadmemory) | **POST** /rabbithole/memory | Upload Memory +*RabbitHoleApi* | [**UploadUrl**](docs/RabbitHoleApi.md#uploadurl) | **POST** /rabbithole/web | Upload URL +*SettingsApi* | [**CreateSetting**](docs/SettingsApi.md#createsetting) | **POST** /settings | Create Setting +*SettingsApi* | [**DeleteSetting**](docs/SettingsApi.md#deletesetting) | **DELETE** /settings/{settingId} | Delete Setting +*SettingsApi* | [**GetSetting**](docs/SettingsApi.md#getsetting) | **GET** /settings/{settingId} | Get Setting +*SettingsApi* | [**GetSettings**](docs/SettingsApi.md#getsettings) | **GET** /settings | Get Settings +*SettingsApi* | [**UpdateSetting**](docs/SettingsApi.md#updatesetting) | **PUT** /settings/{settingId} | Update Setting +*StatusApi* | [**Home**](docs/StatusApi.md#home) | **GET** / | Home + + + +## Documentation for Models + + - [Model.BodyUploadUrl](docs/BodyUploadUrl.md) + - [Model.Collection](docs/Collection.md) + - [Model.CollectionData](docs/CollectionData.md) + - [Model.CollectionsList](docs/CollectionsList.md) + - [Model.ConversationHistory](docs/ConversationHistory.md) + - [Model.ConversationMessage](docs/ConversationMessage.md) + - [Model.Detail](docs/Detail.md) + - [Model.FileResponse](docs/FileResponse.md) + - [Model.Filters](docs/Filters.md) + - [Model.GetPluginSettings200Response](docs/GetPluginSettings200Response.md) + - [Model.HTTPValidationError](docs/HTTPValidationError.md) + - [Model.HooksInner](docs/HooksInner.md) + - [Model.MemoryRecall](docs/MemoryRecall.md) + - [Model.MetaData](docs/MetaData.md) + - [Model.Plugin](docs/Plugin.md) + - [Model.PluginsList](docs/PluginsList.md) + - [Model.QueryData](docs/QueryData.md) + - [Model.ResponseGetAllowedMimetypes](docs/ResponseGetAllowedMimetypes.md) + - [Model.Setting](docs/Setting.md) + - [Model.SettingBody](docs/SettingBody.md) + - [Model.SettingsResponse](docs/SettingsResponse.md) + - [Model.Status](docs/Status.md) + - [Model.ToggleResponse](docs/ToggleResponse.md) + - [Model.ToolsInner](docs/ToolsInner.md) + - [Model.VectorsData](docs/VectorsData.md) + - [Model.WebResponse](docs/WebResponse.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + diff --git a/Test/Program.cs b/Test/Program.cs new file mode 100644 index 0000000..e5dff12 --- /dev/null +++ b/Test/Program.cs @@ -0,0 +1,3 @@ +// See https://aka.ms/new-console-template for more information + +Console.WriteLine("Hello, World!"); \ No newline at end of file diff --git a/Test/Test.sln b/Test/Test.sln new file mode 100644 index 0000000..b29a4cd --- /dev/null +++ b/Test/Test.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestCCatApi", "TestCCatApi.csproj", "{68693FA1-95BA-4E70-AC0D-29B8373E23D7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {68693FA1-95BA-4E70-AC0D-29B8373E23D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {68693FA1-95BA-4E70-AC0D-29B8373E23D7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {68693FA1-95BA-4E70-AC0D-29B8373E23D7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {68693FA1-95BA-4E70-AC0D-29B8373E23D7}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Test/TestCCatApi.csproj b/Test/TestCCatApi.csproj new file mode 100644 index 0000000..2f4fc77 --- /dev/null +++ b/Test/TestCCatApi.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/TestClient/Program.cs b/TestClient/Program.cs new file mode 100644 index 0000000..b3ca21a --- /dev/null +++ b/TestClient/Program.cs @@ -0,0 +1,40 @@ +using System; +using CheshireCatApi; + +namespace TestClient +{ + class Program + { + static void Main(string[] args) + { + // Instantiate the WebSocket client + Configuration config = new Configuration(); + CatClient client = new CatClient(config); + + // Set up event handlers + client.OnMessage += (message) => + { + Console.WriteLine("Received message: " + message); + }; + + client.OnOpen += () => + { + Console.WriteLine("Connected to WebSocket server."); + }; + + client.OnClose += () => + { + Console.WriteLine("Disconnected from WebSocket server."); + }; + + // Connect to the WebSocket server + client.ConnectWebsocket(); + + // Send a message + client.SendMessage("Hello, WebSocket!"); + + // Keep the console application running until a key is pressed + Console.ReadKey(); + } + } +} diff --git a/TestClient/TestClient.csproj b/TestClient/TestClient.csproj new file mode 100644 index 0000000..876e488 --- /dev/null +++ b/TestClient/TestClient.csproj @@ -0,0 +1,14 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + diff --git a/api/openapi.yaml b/api/openapi.yaml new file mode 100644 index 0000000..c2fbe0e --- /dev/null +++ b/api/openapi.yaml @@ -0,0 +1,1583 @@ +openapi: 3.0.2 +info: + description: Customizable AI architecture + title: 😸 Cheshire-Cat API + version: 0.0.5 + x-logo: + url: https://github.com/cheshire-cat-ai/core/blob/main/cheshire-cat.jpeg?raw=true +servers: +- url: / +paths: + /: + get: + description: Server status + operationId: home + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + description: Successful Response + security: [] + summary: Home + tags: + - Status + /settings: + get: + description: Get the entire list of settings available in the database + operationId: get_settings + parameters: + - description: The setting to search + explode: true + in: query + name: search + required: false + schema: + default: "" + title: Search + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingsResponse' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Get Settings + tags: + - Settings + post: + description: Create a new setting in the database + operationId: create_setting + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SettingBody' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Setting' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Create Setting + tags: + - Settings + /settings/{settingId}: + delete: + description: Delete a specific setting in the database + operationId: delete_setting + parameters: + - explode: false + in: path + name: settingId + required: true + schema: + title: Settingid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: {} + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Delete Setting + tags: + - Settings + get: + description: Get the a specific setting from the database + operationId: get_setting + parameters: + - explode: false + in: path + name: settingId + required: true + schema: + title: Settingid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Setting' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Get Setting + tags: + - Settings + put: + description: Update a specific setting in the database if it exists + operationId: update_setting + parameters: + - explode: false + in: path + name: settingId + required: true + schema: + title: Settingid + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SettingBody' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Setting' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Update Setting + tags: + - Settings + /llm/settings: + get: + description: Get the list of the Large Language Models + operationId: get_llms_settings + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingsResponse' + description: Successful Response + security: [] + summary: Get LLMs Settings + tags: + - Large Language Model + /llm/settings/{languageModelName}: + get: + description: Get settings and schema of the specified Large Language Model + operationId: get_llm_settings + parameters: + - explode: false + in: path + name: languageModelName + required: true + schema: + title: languageModelName + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Setting' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Get Llm Settings + tags: + - Large Language Model + put: + description: Upsert the Large Language Model setting + operationId: upsert_llm_setting + parameters: + - explode: false + in: path + name: languageModelName + required: true + schema: + title: languageModelName + type: string + style: simple + requestBody: + content: + application/json: + example: + openai_api_key: your-key-here + schema: + title: Payload + type: object + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Setting' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Upsert LLM Setting + tags: + - Large Language Model + /embedder/settings: + get: + description: Get the list of the Embedders + operationId: get_embedders_settings + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingsResponse' + description: Successful Response + security: [] + summary: Get Embedders Settings + tags: + - Embedder + /embedder/settings/{languageEmbedderName}: + get: + description: Get settings and schema of the specified Embedder + operationId: get_embedder_settings + parameters: + - explode: false + in: path + name: languageEmbedderName + required: true + schema: + title: languageEmbedderName + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Setting' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Get Embedder Settings + tags: + - Embedder + put: + description: Upsert the Embedder setting + operationId: upsert_embedder_setting + parameters: + - explode: false + in: path + name: languageEmbedderName + required: true + schema: + title: languageEmbedderName + type: string + style: simple + requestBody: + content: + application/json: + example: + openai_api_key: your-key-here + schema: + title: Payload + type: object + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Setting' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Upsert Embedder Setting + tags: + - Embedder + /plugins: + get: + description: List both installed and registry plugins + operationId: list_available_plugins + parameters: + - explode: true + in: query + name: query + required: false + schema: + title: Query + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PluginsList' + description: Successful Response + security: [] + summary: List Available Plugins + tags: + - Plugins + /plugins/upload: + post: + description: Install a new plugin from a zip file + operationId: install_plugin + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/BodyInstallPlugin' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FileResponse' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Install Plugin + tags: + - Plugins + /plugins/upload/registry: + post: + description: Install a new plugin from external repository + operationId: install_plugin_from_registry + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BodyUploadUrl' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FileResponse' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Install Plugin From Registry + tags: + - Plugins + /plugins/toggle/{plugin_id}: + put: + description: Enable or disable a single plugin + operationId: toggle_plugin + parameters: + - explode: false + in: path + name: plugin_id + required: true + schema: + title: Plugin ID + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ToggleResponse' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Toggle Plugin + tags: + - Plugins + /plugins/{plugin_id}: + delete: + description: Physically remove a plugin + operationId: delete_plugin + parameters: + - explode: false + in: path + name: plugin_id + required: true + schema: + title: Plugin ID + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Delete Plugin + tags: + - Plugins + get: + description: Returns information on a single plugin + operationId: get_plugin_details + parameters: + - explode: false + in: path + name: plugin_id + required: true + schema: + title: Plugin ID + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Plugin' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Get Plugin Details + tags: + - Plugins + /plugins/settings: + get: + description: Returns the settings of all the plugins + operationId: get_plugins_settings + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SettingsResponse' + description: Successful Response + security: [] + summary: Get Plugins Settings + tags: + - Plugins + /plugins/settings/{plugin_id}: + get: + description: Returns the settings of a specific plugin + operationId: get_plugin_settings + parameters: + - explode: false + in: path + name: plugin_id + required: true + schema: + title: Plugin ID + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/get_plugin_settings_200_response' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Get Plugin Settings + tags: + - Plugins + put: + description: Updates the settings of a specific plugin + operationId: upsert_plugin_settings + parameters: + - explode: false + in: path + name: plugin_id + required: true + schema: + title: Plugin ID + type: string + style: simple + requestBody: + content: + application/json: + example: + setting_a: some value + setting_b: another value + schema: + title: Payload + type: object + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Setting' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Upsert Plugin Settings + tags: + - Plugins + /memory/recall: + get: + description: Search k memories similar to given text. + operationId: recall_memories_from_text + parameters: + - description: Find memories similar to this text. + explode: true + in: query + name: text + required: true + schema: + description: Find memories similar to this text. + title: Text + type: string + style: form + - description: How many memories to return. + explode: true + in: query + name: k + required: false + schema: + default: 100 + description: How many memories to return. + title: K + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MemoryRecall' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Recall Memories From Text + tags: + - Memory + /memory/collections: + delete: + description: Delete and create all collections + operationId: wipe_collections + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + description: Successful Response + security: [] + summary: Wipe Collections + tags: + - Memory + get: + description: Get list of available collections + operationId: get_collections + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CollectionsList' + description: Successful Response + security: [] + summary: Get Collections + tags: + - Memory + /memory/collections/{collection_id}: + delete: + description: Delete and recreate a collection + operationId: wipe_single_collection + parameters: + - explode: false + in: path + name: collection_id + required: true + schema: + title: Collection ID + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Wipe Single Collection + tags: + - Memory + /memory/collections/{collection_id}/points/{memory_id}: + delete: + description: Delete specific point in memory + operationId: delete_point_in_memory + parameters: + - explode: false + in: path + name: collection_id + required: true + schema: + title: Collection ID + type: string + style: simple + - explode: false + in: path + name: memory_id + required: true + schema: + title: Memory ID + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Delete Point In Memory + tags: + - Memory + /memory/collections/{collection_id}/points: + delete: + description: Delete points in memory by filter + operationId: wipe_memory_points + parameters: + - explode: false + in: path + name: collection_id + required: true + schema: + title: Collection Id + type: string + style: simple + requestBody: + content: + application/json: + schema: + default: {} + title: Metadata + type: object + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Wipe Memory Points By Metadata + tags: + - Memory + /memory/conversation_history: + delete: + description: Delete the specified user's conversation history from working memory + operationId: wipe_conversation_history + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + description: Successful Response + security: [] + summary: Wipe Conversation History + tags: + - Memory + get: + description: Get the specified user's conversation history from working memory + operationId: get_conversation_history + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationHistory' + description: Successful Response + security: [] + summary: Get Conversation History + tags: + - Memory + /rabbithole: + post: + description: |- + Upload a file containing text (.txt, .md, .pdf, etc.). File content will be extracted and segmented into chunks. + Chunks will be then vectorized and stored into documents memory. + operationId: upload_file + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/BodyUploadFile' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FileResponse' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Upload File + tags: + - Rabbit Hole + /rabbithole/web: + post: + description: |- + Upload a URL. Website content will be extracted and segmented into chunks. + Chunks will be then vectorized and stored into documents memory. + operationId: upload_url + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BodyUploadUrl' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/WebResponse' + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Upload URL + tags: + - Rabbit Hole + /rabbithole/memory: + post: + description: Upload a memory json file to the cat memory + operationId: upload_memory + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/BodyUploadMemory' + required: true + responses: + "200": + content: + application/json: + schema: + title: Response Upload Memory + type: object + description: Successful Response + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: [] + summary: Upload Memory + tags: + - Rabbit Hole + /rabbithole/allowed-mimetypes: + get: + description: Retrieve the allowed mimetypes that can be ingested by the Rabbit + Hole + operationId: get_allowed_mimetypes + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Response_Get_Allowed_Mimetypes' + description: Successful Response + security: [] + summary: Get Allowed Mimetypes + tags: + - Rabbit Hole +components: + schemas: + BodyInstallPlugin: + properties: + file: + format: binary + title: File + type: string + required: + - file + title: BodyInstallPlugin + type: object + BodyUploadFile: + properties: + file: + format: binary + title: File + type: string + required: + - file + title: BodyUploadFile + type: object + BodyUploadMemory: + properties: + file: + format: binary + title: File + type: string + required: + - file + title: BodyUploadMemory + type: object + BodyUploadUrl: + example: + url: url + properties: + url: + description: URL of the website to which you want to save the content + title: URL + type: string + required: + - url + title: BodyUploadUrl + type: object + Collection: + example: + vectors_count: 0 + name: name + properties: + name: + title: Name + type: string + vectors_count: + title: Vectors Count + type: integer + required: + - name + - vectors_count + title: Collection + type: object + CollectionData: + example: + score: 1 + metadata: + docstring: docstring + name: name + source: source + when: 6 + page_content: page_content + vector: + - 5 + - 5 + id: id + properties: + page_content: + title: Page Content + type: string + metadata: + $ref: '#/components/schemas/MetaData' + id: + title: ID + type: string + score: + title: Score + type: integer + vector: + items: + type: integer + title: Vector + type: array + required: + - id + - metadata + - page_content + - score + - vector + title: CollectionData + type: object + CollectionsList: + example: + collections: + - vectors_count: 0 + name: name + - vectors_count: 0 + name: name + properties: + collections: + items: + $ref: '#/components/schemas/Collection' + title: Collections + type: array + required: + - collections + title: CollectionsList + type: object + FileResponse: + example: + filename: filename + content_type: content_type + info: info + properties: + filename: + title: File Name + type: string + content_type: + title: Content Type + type: string + info: + title: Info + type: string + required: + - content_type + - filename + - info + title: FileResponse + type: object + ConversationMessage: + example: + why: "{}" + message: message + who: who + properties: + who: + title: Who + type: string + message: + title: Message + type: string + why: + title: Why + type: object + required: + - message + - who + title: ConversationMessage + type: object + HTTPValidationError: + example: + detail: + error: error + properties: + detail: + $ref: '#/components/schemas/Detail' + title: HTTPValidationError + type: object + MemoryRecall: + example: + vectors: + collections: + key: + - score: 1 + metadata: + docstring: docstring + name: name + source: source + when: 6 + page_content: page_content + vector: + - 5 + - 5 + id: id + - score: 1 + metadata: + docstring: docstring + name: name + source: source + when: 6 + page_content: page_content + vector: + - 5 + - 5 + id: id + embedder: embedder + query: + vector: + - 0 + - 0 + text: text + properties: + query: + $ref: '#/components/schemas/QueryData' + vectors: + $ref: '#/components/schemas/VectorsData' + required: + - query + - vectors + title: MemoryRecall + type: object + MetaData: + example: + docstring: docstring + name: name + source: source + when: 6 + properties: + source: + title: Source + type: string + when: + title: When + type: integer + docstring: + title: DocString + type: string + name: + title: Name + type: string + required: + - source + - when + title: MetaData + type: object + Plugin: + example: + author_name: author_name + upgrade: upgrade + thumb: thumb + description: description + active: true + version: version + tools: + - name: name + - name: name + url: url + tags: tags + plugin_url: plugin_url + author_url: author_url + name: name + id: id + hooks: + - name: name + priority: 0 + - name: name + priority: 0 + properties: + id: + title: ID + type: string + name: + title: Name + type: string + description: + title: Description + type: string + author_name: + title: Author Name + type: string + author_url: + title: Author URL + type: string + plugin_url: + title: Plugin URL + type: string + tags: + title: Tags + type: string + thumb: + title: Thumb + type: string + version: + title: Version + type: string + active: + title: Active + type: boolean + url: + title: Install URL + type: string + upgrade: + title: Upgrade + type: string + hooks: + items: + $ref: '#/components/schemas/Hooks_inner' + title: Hooks + type: array + tools: + items: + $ref: '#/components/schemas/Tools_inner' + title: Tools + type: array + required: + - author_name + - author_url + - description + - id + - name + - plugin_url + - tags + - thumb + - version + title: Plugin + type: object + PluginsList: + example: + installed: + - author_name: author_name + upgrade: upgrade + thumb: thumb + description: description + active: true + version: version + tools: + - name: name + - name: name + url: url + tags: tags + plugin_url: plugin_url + author_url: author_url + name: name + id: id + hooks: + - name: name + priority: 0 + - name: name + priority: 0 + - author_name: author_name + upgrade: upgrade + thumb: thumb + description: description + active: true + version: version + tools: + - name: name + - name: name + url: url + tags: tags + plugin_url: plugin_url + author_url: author_url + name: name + id: id + hooks: + - name: name + priority: 0 + - name: name + priority: 0 + registry: + - author_name: author_name + upgrade: upgrade + thumb: thumb + description: description + active: true + version: version + tools: + - name: name + - name: name + url: url + tags: tags + plugin_url: plugin_url + author_url: author_url + name: name + id: id + hooks: + - name: name + priority: 0 + - name: name + priority: 0 + - author_name: author_name + upgrade: upgrade + thumb: thumb + description: description + active: true + version: version + tools: + - name: name + - name: name + url: url + tags: tags + plugin_url: plugin_url + author_url: author_url + name: name + id: id + hooks: + - name: name + priority: 0 + - name: name + priority: 0 + filters: + query: query + properties: + filters: + $ref: '#/components/schemas/Filters' + installed: + items: + $ref: '#/components/schemas/Plugin' + title: Installed + type: array + registry: + items: + $ref: '#/components/schemas/Plugin' + title: Registry + type: array + required: + - filters + - installed + - registry + title: PluginsList + type: object + QueryData: + example: + vector: + - 0 + - 0 + text: text + properties: + text: + title: Text + type: string + vector: + items: + type: integer + title: Vector + type: array + required: + - text + - vector + title: QueryData + type: object + SettingBody: + example: + name: name + category: category + value: "{}" + properties: + name: + title: Name + type: string + value: + title: Value + type: object + category: + title: Category + type: string + required: + - name + - value + title: SettingBody + type: object + Setting: + example: + schema: "{}" + name: name + value: "{}" + properties: + name: + type: string + value: + type: object + schema: + type: object + required: + - name + - value + title: Setting + type: object + SettingsResponse: + example: + settings: + - schema: "{}" + name: name + value: "{}" + - schema: "{}" + name: name + value: "{}" + selected_configuration: selected_configuration + properties: + settings: + items: + $ref: '#/components/schemas/Setting' + title: Settings + type: array + selected_configuration: + title: SelectedConfiguration + type: string + required: + - settings + title: SettingsResponse + type: object + VectorsData: + example: + collections: + key: + - score: 1 + metadata: + docstring: docstring + name: name + source: source + when: 6 + page_content: page_content + vector: + - 5 + - 5 + id: id + - score: 1 + metadata: + docstring: docstring + name: name + source: source + when: 6 + page_content: page_content + vector: + - 5 + - 5 + id: id + embedder: embedder + properties: + embedder: + title: Embedder + type: string + collections: + additionalProperties: + items: + $ref: '#/components/schemas/CollectionData' + type: array + title: Collections + type: object + required: + - collections + - embedder + title: VectorsData + type: object + WebResponse: + example: + url: url + info: info + properties: + url: + title: URL + type: string + info: + title: Info + type: string + required: + - info + - url + title: WebResponse + type: object + DeleteResponse: + items: + type: string + title: DeleteResponse + type: array + Status: + example: + version: version + status: status + properties: + status: + title: Status + type: string + version: + title: Version + type: string + required: + - status + - version + title: Status + type: object + ToggleResponse: + example: + info: info + properties: + info: + title: Info + type: string + required: + - info + title: ToggleResponse + type: object + get_plugin_settings_200_response: + allOf: + - $ref: '#/components/schemas/Setting' + - properties: + schema: + type: object + required: + - schema + type: object + example: + schema: "{}" + name: name + value: "{}" + ConversationHistory: + example: + history: + - why: "{}" + message: message + who: who + - why: "{}" + message: message + who: who + properties: + history: + items: + $ref: '#/components/schemas/ConversationMessage' + title: History + type: array + required: + - history + title: ConversationHistory + type: object + Response_Get_Allowed_Mimetypes: + example: + allowed: + - allowed + - allowed + properties: + allowed: + items: + type: string + title: Allowed + type: array + title: Response Get Allowed Mimetypes + type: object + Detail: + example: + error: error + properties: + error: + title: Message + type: string + required: + - error + title: Detail + type: object + Hooks_inner: + example: + name: name + priority: 0 + properties: + name: + title: Name + type: string + priority: + title: Priority + type: integer + required: + - name + - priority + type: object + Tools_inner: + example: + name: name + properties: + name: + title: Name + type: string + required: + - name + type: object + Filters: + example: + query: query + properties: + query: + nullable: true + title: Query + type: string + title: Filters + type: object + securitySchemes: {} + diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..f0a9707 --- /dev/null +++ b/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\CheshireCatApi\CheshireCatApi.csproj -o ../../output -c Release --no-build diff --git a/catapi.json b/catapi.json new file mode 100644 index 0000000..7731450 --- /dev/null +++ b/catapi.json @@ -0,0 +1,1901 @@ +{ + "openapi": "3.0.2", + "info": { + "title": "😸 Cheshire-Cat API", + "description": "Customizable AI architecture", + "version": "0.0.5", + "x-logo": { + "url": "https://github.com/cheshire-cat-ai/core/blob/main/cheshire-cat.jpeg?raw=true" + } + }, + "paths": { + "/": { + "get": { + "tags": [ + "Status" + ], + "summary": "Home", + "description": "Server status", + "operationId": "home", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Status" + } + } + } + } + }, + "security": [] + } + }, + "/settings": { + "get": { + "tags": [ + "Settings" + ], + "summary": "Get Settings", + "description": "Get the entire list of settings available in the database", + "operationId": "get_settings", + "parameters": [ + { + "required": false, + "schema": { + "title": "Search", + "type": "string", + "default": "" + }, + "description": "The setting to search", + "name": "search", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SettingsResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + }, + "post": { + "tags": [ + "Settings" + ], + "summary": "Create Setting", + "description": "Create a new setting in the database", + "operationId": "create_setting", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SettingBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Setting" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/settings/{settingId}": { + "get": { + "tags": [ + "Settings" + ], + "summary": "Get Setting", + "description": "Get the a specific setting from the database", + "operationId": "get_setting", + "parameters": [ + { + "required": true, + "schema": { + "title": "Settingid", + "type": "string" + }, + "name": "settingId", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Setting" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + }, + "delete": { + "tags": [ + "Settings" + ], + "summary": "Delete Setting", + "description": "Delete a specific setting in the database", + "operationId": "delete_setting", + "parameters": [ + { + "required": true, + "schema": { + "title": "Settingid", + "type": "string" + }, + "name": "settingId", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + }, + "put": { + "tags": [ + "Settings" + ], + "summary": "Update Setting", + "description": "Update a specific setting in the database if it exists", + "operationId": "update_setting", + "parameters": [ + { + "required": true, + "schema": { + "title": "Settingid", + "type": "string" + }, + "name": "settingId", + "in": "path" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SettingBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Setting" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/llm/settings": { + "get": { + "tags": [ + "Large Language Model" + ], + "summary": "Get LLMs Settings", + "description": "Get the list of the Large Language Models", + "operationId": "get_llms_settings", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SettingsResponse" + } + } + } + } + }, + "security": [] + } + }, + "/llm/settings/{languageModelName}": { + "get": { + "tags": [ + "Large Language Model" + ], + "summary": "Get Llm Settings", + "description": "Get settings and schema of the specified Large Language Model", + "operationId": "get_llm_settings", + "parameters": [ + { + "required": true, + "schema": { + "title": "languageModelName", + "type": "string" + }, + "name": "languageModelName", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Setting" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + }, + "put": { + "tags": [ + "Large Language Model" + ], + "summary": "Upsert LLM Setting", + "description": "Upsert the Large Language Model setting", + "operationId": "upsert_llm_setting", + "parameters": [ + { + "required": true, + "schema": { + "title": "languageModelName", + "type": "string" + }, + "name": "languageModelName", + "in": "path" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "Payload", + "type": "object" + }, + "example": { + "openai_api_key": "your-key-here" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Setting" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/embedder/settings": { + "get": { + "tags": [ + "Embedder" + ], + "summary": "Get Embedders Settings", + "description": "Get the list of the Embedders", + "operationId": "get_embedders_settings", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SettingsResponse" + } + } + } + } + }, + "security": [] + } + }, + "/embedder/settings/{languageEmbedderName}": { + "get": { + "tags": [ + "Embedder" + ], + "summary": "Get Embedder Settings", + "description": "Get settings and schema of the specified Embedder", + "operationId": "get_embedder_settings", + "parameters": [ + { + "required": true, + "schema": { + "title": "languageEmbedderName", + "type": "string" + }, + "name": "languageEmbedderName", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Setting" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + }, + "put": { + "tags": [ + "Embedder" + ], + "summary": "Upsert Embedder Setting", + "description": "Upsert the Embedder setting", + "operationId": "upsert_embedder_setting", + "parameters": [ + { + "required": true, + "schema": { + "title": "languageEmbedderName", + "type": "string" + }, + "name": "languageEmbedderName", + "in": "path" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "Payload", + "type": "object" + }, + "example": { + "openai_api_key": "your-key-here" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Setting" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/plugins": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "List Available Plugins", + "description": "List both installed and registry plugins", + "operationId": "list_available_plugins", + "parameters": [ + { + "required": false, + "schema": { + "title": "Query", + "type": "string" + }, + "name": "query", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PluginsList" + } + } + } + } + }, + "security": [] + } + }, + "/plugins/upload": { + "post": { + "tags": [ + "Plugins" + ], + "summary": "Install Plugin", + "description": "Install a new plugin from a zip file", + "operationId": "install_plugin", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/BodyInstallPlugin" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/plugins/upload/registry": { + "post": { + "tags": [ + "Plugins" + ], + "summary": "Install Plugin From Registry", + "description": "Install a new plugin from external repository", + "operationId": "install_plugin_from_registry", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BodyUploadUrl" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/plugins/toggle/{plugin_id}": { + "put": { + "tags": [ + "Plugins" + ], + "summary": "Toggle Plugin", + "description": "Enable or disable a single plugin", + "operationId": "toggle_plugin", + "parameters": [ + { + "required": true, + "schema": { + "title": "Plugin ID", + "type": "string" + }, + "name": "plugin_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "title": "ToggleResponse", + "required": [ + "info" + ], + "type": "object", + "properties": { + "info": { + "title": "Info", + "type": "string" + } + } + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/plugins/{plugin_id}": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Get Plugin Details", + "description": "Returns information on a single plugin", + "operationId": "get_plugin_details", + "parameters": [ + { + "required": true, + "schema": { + "title": "Plugin ID", + "type": "string" + }, + "name": "plugin_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + }, + "delete": { + "tags": [ + "Plugins" + ], + "summary": "Delete Plugin", + "description": "Physically remove a plugin", + "operationId": "delete_plugin", + "parameters": [ + { + "required": true, + "schema": { + "title": "Plugin ID", + "type": "string" + }, + "name": "plugin_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/plugins/settings": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Get Plugins Settings", + "description": "Returns the settings of all the plugins", + "operationId": "get_plugins_settings", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SettingsResponse" + } + } + } + } + }, + "security": [] + } + }, + "/plugins/settings/{plugin_id}": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Get Plugin Settings", + "description": "Returns the settings of a specific plugin", + "operationId": "get_plugin_settings", + "parameters": [ + { + "required": true, + "schema": { + "title": "Plugin ID", + "type": "string" + }, + "name": "plugin_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Setting" + }, + { + "required": [ + "schema" + ], + "type": "object", + "properties": { + "schema": { + "type": "object" + } + } + } + ] + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + }, + "put": { + "tags": [ + "Plugins" + ], + "summary": "Upsert Plugin Settings", + "description": "Updates the settings of a specific plugin", + "operationId": "upsert_plugin_settings", + "parameters": [ + { + "required": true, + "schema": { + "title": "Plugin ID", + "type": "string" + }, + "name": "plugin_id", + "in": "path" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "Payload", + "type": "object" + }, + "example": { + "setting_a": "some value", + "setting_b": "another value" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Setting" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/memory/recall": { + "get": { + "tags": [ + "Memory" + ], + "summary": "Recall Memories From Text", + "description": "Search k memories similar to given text.", + "operationId": "recall_memories_from_text", + "parameters": [ + { + "description": "Find memories similar to this text.", + "required": true, + "schema": { + "title": "Text", + "type": "string", + "description": "Find memories similar to this text." + }, + "name": "text", + "in": "query" + }, + { + "description": "How many memories to return.", + "required": false, + "schema": { + "title": "K", + "type": "integer", + "description": "How many memories to return.", + "default": 100 + }, + "name": "k", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MemoryRecall" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/memory/collections": { + "get": { + "tags": [ + "Memory" + ], + "summary": "Get Collections", + "description": "Get list of available collections", + "operationId": "get_collections", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionsList" + } + } + } + } + }, + "security": [] + }, + "delete": { + "tags": [ + "Memory" + ], + "summary": "Wipe Collections", + "description": "Delete and create all collections", + "operationId": "wipe_collections", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteResponse" + } + } + } + } + }, + "security": [] + } + }, + "/memory/collections/{collection_id}": { + "delete": { + "tags": [ + "Memory" + ], + "summary": "Wipe Single Collection", + "description": "Delete and recreate a collection", + "operationId": "wipe_single_collection", + "parameters": [ + { + "required": true, + "schema": { + "title": "Collection ID", + "type": "string" + }, + "name": "collection_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/memory/collections/{collection_id}/points/{memory_id}": { + "delete": { + "tags": [ + "Memory" + ], + "summary": "Delete Point In Memory", + "description": "Delete specific point in memory", + "operationId": "delete_point_in_memory", + "parameters": [ + { + "required": true, + "schema": { + "title": "Collection ID", + "type": "string" + }, + "name": "collection_id", + "in": "path" + }, + { + "required": true, + "schema": { + "title": "Memory ID", + "type": "string" + }, + "name": "memory_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/memory/collections/{collection_id}/points": { + "delete": { + "tags": [ + "Memory" + ], + "summary": "Wipe Memory Points By Metadata", + "description": "Delete points in memory by filter", + "operationId": "wipe_memory_points", + "security": [], + "parameters": [ + { + "name": "collection_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Collection Id" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "default": {}, + "title": "Metadata" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/memory/conversation_history": { + "get": { + "tags": [ + "Memory" + ], + "summary": "Get Conversation History", + "description": "Get the specified user's conversation history from working memory", + "operationId": "get_conversation_history", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "title": "ConversationHistory", + "type": "object", + "required": [ + "history" + ], + "properties": { + "history": { + "title": "History", + "type": "array", + "items": { + "$ref": "#/components/schemas/ConversationMessage" + } + } + } + } + } + } + } + }, + "security": [] + }, + "delete": { + "tags": [ + "Memory" + ], + "summary": "Wipe Conversation History", + "description": "Delete the specified user's conversation history from working memory", + "operationId": "wipe_conversation_history", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteResponse" + } + } + } + } + }, + "security": [] + } + }, + "/rabbithole": { + "post": { + "tags": [ + "Rabbit Hole" + ], + "summary": "Upload File", + "description": "Upload a file containing text (.txt, .md, .pdf, etc.). File content will be extracted and segmented into chunks.\nChunks will be then vectorized and stored into documents memory.", + "operationId": "upload_file", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/BodyUploadFile" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/rabbithole/web": { + "post": { + "tags": [ + "Rabbit Hole" + ], + "summary": "Upload URL", + "description": "Upload a URL. Website content will be extracted and segmented into chunks.\nChunks will be then vectorized and stored into documents memory.", + "operationId": "upload_url", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BodyUploadUrl" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/rabbithole/memory": { + "post": { + "tags": [ + "Rabbit Hole" + ], + "summary": "Upload Memory", + "description": "Upload a memory json file to the cat memory", + "operationId": "upload_memory", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/BodyUploadMemory" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "title": "Response Upload Memory", + "type": "object" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [] + } + }, + "/rabbithole/allowed-mimetypes": { + "get": { + "tags": [ + "Rabbit Hole" + ], + "summary": "Get Allowed Mimetypes", + "description": "Retrieve the allowed mimetypes that can be ingested by the Rabbit Hole", + "operationId": "get_allowed_mimetypes", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "title": "Response Get Allowed Mimetypes", + "type": "object", + "properties": { + "allowed": { + "title": "Allowed", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "security": [] + } + } + }, + "components": { + "schemas": { + "BodyInstallPlugin": { + "title": "BodyInstallPlugin", + "required": [ + "file" + ], + "type": "object", + "properties": { + "file": { + "title": "File", + "type": "string", + "format": "binary" + } + } + }, + "BodyUploadFile": { + "title": "BodyUploadFile", + "required": [ + "file" + ], + "type": "object", + "properties": { + "file": { + "title": "File", + "type": "string", + "format": "binary" + } + } + }, + "BodyUploadMemory": { + "title": "BodyUploadMemory", + "required": [ + "file" + ], + "type": "object", + "properties": { + "file": { + "title": "File", + "type": "string", + "format": "binary" + } + } + }, + "BodyUploadUrl": { + "title": "BodyUploadUrl", + "required": [ + "url" + ], + "type": "object", + "properties": { + "url": { + "title": "URL", + "type": "string", + "description": "URL of the website to which you want to save the content" + } + } + }, + "Collection": { + "title": "Collection", + "required": [ + "name", + "vectors_count" + ], + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "vectors_count": { + "title": "Vectors Count", + "type": "integer" + } + } + }, + "CollectionData": { + "title": "CollectionData", + "required": [ + "page_content", + "metadata", + "score", + "vector", + "id" + ], + "type": "object", + "properties": { + "page_content": { + "title": "Page Content", + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/MetaData" + }, + "id": { + "title": "ID", + "type": "string" + }, + "score": { + "title": "Score", + "type": "integer" + }, + "vector": { + "title": "Vector", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "CollectionsList": { + "title": "CollectionsList", + "required": [ + "collections" + ], + "type": "object", + "properties": { + "collections": { + "title": "Collections", + "type": "array", + "items": { + "$ref": "#/components/schemas/Collection" + } + } + } + }, + "FileResponse": { + "title": "FileResponse", + "required": [ + "filename", + "content_type", + "info" + ], + "type": "object", + "properties": { + "filename": { + "title": "File Name", + "type": "string" + }, + "content_type": { + "title": "Content Type", + "type": "string" + }, + "info": { + "title": "Info", + "type": "string" + } + } + }, + "ConversationMessage": { + "title": "ConversationMessage", + "required": [ + "who", + "message" + ], + "type": "object", + "properties": { + "who": { + "title": "Who", + "type": "string" + }, + "message": { + "title": "Message", + "type": "string" + }, + "why": { + "title": "Why", + "type": "object" + } + } + }, + "HTTPValidationError": { + "title": "HTTPValidationError", + "type": "object", + "properties": { + "detail": { + "title": "Detail", + "required": [ + "error" + ], + "type": "object", + "properties": { + "error": { + "title": "Message", + "type": "string" + } + } + } + } + }, + "MemoryRecall": { + "title": "MemoryRecall", + "required": [ + "query", + "vectors" + ], + "type": "object", + "properties": { + "query": { + "$ref": "#/components/schemas/QueryData" + }, + "vectors": { + "$ref": "#/components/schemas/VectorsData" + } + } + }, + "MetaData": { + "title": "MetaData", + "required": [ + "source", + "when" + ], + "type": "object", + "properties": { + "source": { + "title": "Source", + "type": "string" + }, + "when": { + "title": "When", + "type": "integer" + }, + "docstring": { + "title": "DocString", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + } + } + }, + "Plugin": { + "title": "Plugin", + "required": [ + "id", + "name", + "description", + "author_name", + "author_url", + "plugin_url", + "tags", + "thumb", + "version" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string" + }, + "author_name": { + "title": "Author Name", + "type": "string" + }, + "author_url": { + "title": "Author URL", + "type": "string" + }, + "plugin_url": { + "title": "Plugin URL", + "type": "string" + }, + "tags": { + "title": "Tags", + "type": "string" + }, + "thumb": { + "title": "Thumb", + "type": "string" + }, + "version": { + "title": "Version", + "type": "string" + }, + "active": { + "title": "Active", + "type": "boolean" + }, + "url": { + "title": "Install URL", + "type": "string" + }, + "upgrade": { + "title": "Upgrade", + "type": "string" + }, + "hooks": { + "title": "Hooks", + "type": "array", + "items": { + "required": [ + "name", + "priority" + ], + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "priority": { + "title": "Priority", + "type": "integer" + } + } + } + }, + "tools": { + "title": "Tools", + "type": "array", + "items": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + } + } + } + } + }, + "PluginsList": { + "title": "PluginsList", + "required": [ + "filters", + "installed", + "registry" + ], + "type": "object", + "properties": { + "filters": { + "title": "Filters", + "type": "object", + "properties": { + "query": { + "title": "Query", + "nullable": "true", + "type": "string" + } + } + }, + "installed": { + "title": "Installed", + "type": "array", + "items": { + "$ref": "#/components/schemas/Plugin" + } + }, + "registry": { + "title": "Registry", + "type": "array", + "items": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "QueryData": { + "title": "QueryData", + "required": [ + "text", + "vector" + ], + "type": "object", + "properties": { + "text": { + "title": "Text", + "type": "string" + }, + "vector": { + "title": "Vector", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "SettingBody": { + "title": "SettingBody", + "required": [ + "name", + "value" + ], + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "value": { + "title": "Value", + "type": "object" + }, + "category": { + "title": "Category", + "type": "string" + } + } + }, + "Setting": { + "title": "Setting", + "type": "object", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "object" + }, + "schema": { + "type": "object" + } + } + }, + "SettingsResponse": { + "title": "SettingsResponse", + "required": [ + "settings" + ], + "type": "object", + "properties": { + "settings": { + "title": "Settings", + "type": "array", + "items": { + "$ref": "#/components/schemas/Setting" + } + }, + "selected_configuration": { + "title": "SelectedConfiguration", + "type": "string" + } + } + }, + "VectorsData": { + "title": "VectorsData", + "required": [ + "embedder", + "collections" + ], + "type": "object", + "properties": { + "embedder": { + "title": "Embedder", + "type": "string" + }, + "collections": { + "title": "Collections", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollectionData" + } + } + } + } + }, + "WebResponse": { + "title": "WebResponse", + "required": [ + "url", + "info" + ], + "type": "object", + "properties": { + "url": { + "title": "URL", + "type": "string" + }, + "info": { + "title": "Info", + "type": "string" + } + } + }, + "DeleteResponse": { + "title": "DeleteResponse", + "type": "array", + "items": { + "type": "string" + } + }, + "Status": { + "title": "Status", + "required": [ + "status", + "version" + ], + "type": "object", + "properties": { + "status": { + "title": "Status", + "type": "string" + }, + "version": { + "title": "Version", + "type": "string" + } + } + } + }, + "securitySchemes": {} + } +} \ No newline at end of file diff --git a/docs/BodyUploadUrl.md b/docs/BodyUploadUrl.md new file mode 100644 index 0000000..7118723 --- /dev/null +++ b/docs/BodyUploadUrl.md @@ -0,0 +1,10 @@ +# CheshireCatApi.Model.BodyUploadUrl + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | URL of the website to which you want to save the content | + +[[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/docs/Collection.md b/docs/Collection.md new file mode 100644 index 0000000..d742490 --- /dev/null +++ b/docs/Collection.md @@ -0,0 +1,11 @@ +# CheshireCatApi.Model.Collection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**VectorsCount** | **int** | | + +[[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/docs/CollectionData.md b/docs/CollectionData.md new file mode 100644 index 0000000..032f728 --- /dev/null +++ b/docs/CollectionData.md @@ -0,0 +1,14 @@ +# CheshireCatApi.Model.CollectionData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PageContent** | **string** | | +**Metadata** | [**MetaData**](MetaData.md) | | +**Id** | **string** | | +**Score** | **int** | | +**Vector** | **List<int>** | | + +[[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/docs/CollectionsList.md b/docs/CollectionsList.md new file mode 100644 index 0000000..a3005c8 --- /dev/null +++ b/docs/CollectionsList.md @@ -0,0 +1,10 @@ +# CheshireCatApi.Model.CollectionsList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Collections** | **List<Collection>** | | + +[[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/docs/ConversationHistory.md b/docs/ConversationHistory.md new file mode 100644 index 0000000..d86e47d --- /dev/null +++ b/docs/ConversationHistory.md @@ -0,0 +1,10 @@ +# CheshireCatApi.Model.ConversationHistory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**History** | [**List<ConversationMessage>**](ConversationMessage.md) | | + +[[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/docs/ConversationMessage.md b/docs/ConversationMessage.md new file mode 100644 index 0000000..6b4ef18 --- /dev/null +++ b/docs/ConversationMessage.md @@ -0,0 +1,12 @@ +# CheshireCatApi.Model.ConversationMessage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Who** | **string** | | +**Message** | **string** | | +**Why** | **Object** | | [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/docs/Detail.md b/docs/Detail.md new file mode 100644 index 0000000..76fa30e --- /dev/null +++ b/docs/Detail.md @@ -0,0 +1,10 @@ +# CheshireCatApi.Model.Detail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/EmbedderApi.md b/docs/EmbedderApi.md new file mode 100644 index 0000000..3abf683 --- /dev/null +++ b/docs/EmbedderApi.md @@ -0,0 +1,282 @@ +# CheshireCatApi.Api.EmbedderApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**GetEmbedderSettings**](EmbedderApi.md#getembeddersettings) | **GET** /embedder/settings/{languageEmbedderName} | Get Embedder Settings | +| [**GetEmbeddersSettings**](EmbedderApi.md#getembedderssettings) | **GET** /embedder/settings | Get Embedders Settings | +| [**UpsertEmbedderSetting**](EmbedderApi.md#upsertembeddersetting) | **PUT** /embedder/settings/{languageEmbedderName} | Upsert Embedder Setting | + + +# **GetEmbedderSettings** +> Setting GetEmbedderSettings (string languageEmbedderName) + +Get Embedder Settings + +Get settings and schema of the specified Embedder + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class GetEmbedderSettingsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new EmbedderApi(config); + var languageEmbedderName = "languageEmbedderName_example"; // string | + + try + { + // Get Embedder Settings + Setting result = apiInstance.GetEmbedderSettings(languageEmbedderName); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling EmbedderApi.GetEmbedderSettings: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetEmbedderSettingsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Embedder Settings + ApiResponse response = apiInstance.GetEmbedderSettingsWithHttpInfo(languageEmbedderName); + 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 EmbedderApi.GetEmbedderSettingsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **languageEmbedderName** | **string** | | | + +### Return type + +[**Setting**](Setting.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **GetEmbeddersSettings** +> SettingsResponse GetEmbeddersSettings () + +Get Embedders Settings + +Get the list of the Embedders + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class GetEmbeddersSettingsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new EmbedderApi(config); + + try + { + // Get Embedders Settings + SettingsResponse result = apiInstance.GetEmbeddersSettings(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling EmbedderApi.GetEmbeddersSettings: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetEmbeddersSettingsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Embedders Settings + ApiResponse response = apiInstance.GetEmbeddersSettingsWithHttpInfo(); + 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 EmbedderApi.GetEmbeddersSettingsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**SettingsResponse**](SettingsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpsertEmbedderSetting** +> Setting UpsertEmbedderSetting (string languageEmbedderName, Object body) + +Upsert Embedder Setting + +Upsert the Embedder setting + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class UpsertEmbedderSettingExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new EmbedderApi(config); + var languageEmbedderName = "languageEmbedderName_example"; // string | + var body = {"openai_api_key":"your-key-here"}; // Object | + + try + { + // Upsert Embedder Setting + Setting result = apiInstance.UpsertEmbedderSetting(languageEmbedderName, body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling EmbedderApi.UpsertEmbedderSetting: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpsertEmbedderSettingWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Upsert Embedder Setting + ApiResponse response = apiInstance.UpsertEmbedderSettingWithHttpInfo(languageEmbedderName, body); + 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 EmbedderApi.UpsertEmbedderSettingWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **languageEmbedderName** | **string** | | | +| **body** | **Object** | | | + +### Return type + +[**Setting**](Setting.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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/docs/FileResponse.md b/docs/FileResponse.md new file mode 100644 index 0000000..90081a6 --- /dev/null +++ b/docs/FileResponse.md @@ -0,0 +1,12 @@ +# CheshireCatApi.Model.FileResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Filename** | **string** | | +**ContentType** | **string** | | +**Info** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/Filters.md b/docs/Filters.md new file mode 100644 index 0000000..f51d02c --- /dev/null +++ b/docs/Filters.md @@ -0,0 +1,10 @@ +# CheshireCatApi.Model.Filters + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Query** | **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/docs/GetPluginSettings200Response.md b/docs/GetPluginSettings200Response.md new file mode 100644 index 0000000..8807f0f --- /dev/null +++ b/docs/GetPluginSettings200Response.md @@ -0,0 +1,12 @@ +# CheshireCatApi.Model.GetPluginSettings200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**Value** | **Object** | | +**Schema** | **Object** | | + +[[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/docs/HTTPValidationError.md b/docs/HTTPValidationError.md new file mode 100644 index 0000000..8a86b22 --- /dev/null +++ b/docs/HTTPValidationError.md @@ -0,0 +1,10 @@ +# CheshireCatApi.Model.HTTPValidationError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Detail** | [**Detail**](Detail.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/docs/HooksInner.md b/docs/HooksInner.md new file mode 100644 index 0000000..404cac4 --- /dev/null +++ b/docs/HooksInner.md @@ -0,0 +1,11 @@ +# CheshireCatApi.Model.HooksInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**Priority** | **int** | | + +[[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/docs/LargeLanguageModelApi.md b/docs/LargeLanguageModelApi.md new file mode 100644 index 0000000..5b18c7d --- /dev/null +++ b/docs/LargeLanguageModelApi.md @@ -0,0 +1,282 @@ +# CheshireCatApi.Api.LargeLanguageModelApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**GetLlmSettings**](LargeLanguageModelApi.md#getllmsettings) | **GET** /llm/settings/{languageModelName} | Get Llm Settings | +| [**GetLlmsSettings**](LargeLanguageModelApi.md#getllmssettings) | **GET** /llm/settings | Get LLMs Settings | +| [**UpsertLlmSetting**](LargeLanguageModelApi.md#upsertllmsetting) | **PUT** /llm/settings/{languageModelName} | Upsert LLM Setting | + + +# **GetLlmSettings** +> Setting GetLlmSettings (string languageModelName) + +Get Llm Settings + +Get settings and schema of the specified Large Language Model + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class GetLlmSettingsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new LargeLanguageModelApi(config); + var languageModelName = "languageModelName_example"; // string | + + try + { + // Get Llm Settings + Setting result = apiInstance.GetLlmSettings(languageModelName); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling LargeLanguageModelApi.GetLlmSettings: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetLlmSettingsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Llm Settings + ApiResponse response = apiInstance.GetLlmSettingsWithHttpInfo(languageModelName); + 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 LargeLanguageModelApi.GetLlmSettingsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **languageModelName** | **string** | | | + +### Return type + +[**Setting**](Setting.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **GetLlmsSettings** +> SettingsResponse GetLlmsSettings () + +Get LLMs Settings + +Get the list of the Large Language Models + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class GetLlmsSettingsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new LargeLanguageModelApi(config); + + try + { + // Get LLMs Settings + SettingsResponse result = apiInstance.GetLlmsSettings(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling LargeLanguageModelApi.GetLlmsSettings: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetLlmsSettingsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get LLMs Settings + ApiResponse response = apiInstance.GetLlmsSettingsWithHttpInfo(); + 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 LargeLanguageModelApi.GetLlmsSettingsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**SettingsResponse**](SettingsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpsertLlmSetting** +> Setting UpsertLlmSetting (string languageModelName, Object body) + +Upsert LLM Setting + +Upsert the Large Language Model setting + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class UpsertLlmSettingExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new LargeLanguageModelApi(config); + var languageModelName = "languageModelName_example"; // string | + var body = {"openai_api_key":"your-key-here"}; // Object | + + try + { + // Upsert LLM Setting + Setting result = apiInstance.UpsertLlmSetting(languageModelName, body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling LargeLanguageModelApi.UpsertLlmSetting: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpsertLlmSettingWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Upsert LLM Setting + ApiResponse response = apiInstance.UpsertLlmSettingWithHttpInfo(languageModelName, body); + 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 LargeLanguageModelApi.UpsertLlmSettingWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **languageModelName** | **string** | | | +| **body** | **Object** | | | + +### Return type + +[**Setting**](Setting.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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/docs/MemoryApi.md b/docs/MemoryApi.md new file mode 100644 index 0000000..e0be5f4 --- /dev/null +++ b/docs/MemoryApi.md @@ -0,0 +1,733 @@ +# CheshireCatApi.Api.MemoryApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**DeletePointInMemory**](MemoryApi.md#deletepointinmemory) | **DELETE** /memory/collections/{collection_id}/points/{memory_id} | Delete Point In Memory | +| [**GetCollections**](MemoryApi.md#getcollections) | **GET** /memory/collections | Get Collections | +| [**GetConversationHistory**](MemoryApi.md#getconversationhistory) | **GET** /memory/conversation_history | Get Conversation History | +| [**RecallMemoriesFromText**](MemoryApi.md#recallmemoriesfromtext) | **GET** /memory/recall | Recall Memories From Text | +| [**WipeCollections**](MemoryApi.md#wipecollections) | **DELETE** /memory/collections | Wipe Collections | +| [**WipeConversationHistory**](MemoryApi.md#wipeconversationhistory) | **DELETE** /memory/conversation_history | Wipe Conversation History | +| [**WipeMemoryPoints**](MemoryApi.md#wipememorypoints) | **DELETE** /memory/collections/{collection_id}/points | Wipe Memory Points By Metadata | +| [**WipeSingleCollection**](MemoryApi.md#wipesinglecollection) | **DELETE** /memory/collections/{collection_id} | Wipe Single Collection | + + +# **DeletePointInMemory** +> List<string> DeletePointInMemory (string collectionId, string memoryId) + +Delete Point In Memory + +Delete specific point in memory + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class DeletePointInMemoryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new MemoryApi(config); + var collectionId = "collectionId_example"; // string | + var memoryId = "memoryId_example"; // string | + + try + { + // Delete Point In Memory + List result = apiInstance.DeletePointInMemory(collectionId, memoryId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling MemoryApi.DeletePointInMemory: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeletePointInMemoryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete Point In Memory + ApiResponse> response = apiInstance.DeletePointInMemoryWithHttpInfo(collectionId, memoryId); + 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 MemoryApi.DeletePointInMemoryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **collectionId** | **string** | | | +| **memoryId** | **string** | | | + +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **GetCollections** +> CollectionsList GetCollections () + +Get Collections + +Get list of available collections + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class GetCollectionsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new MemoryApi(config); + + try + { + // Get Collections + CollectionsList result = apiInstance.GetCollections(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling MemoryApi.GetCollections: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetCollectionsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Collections + ApiResponse response = apiInstance.GetCollectionsWithHttpInfo(); + 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 MemoryApi.GetCollectionsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**CollectionsList**](CollectionsList.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetConversationHistory** +> ConversationHistory GetConversationHistory () + +Get Conversation History + +Get the specified user's conversation history from working memory + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class GetConversationHistoryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new MemoryApi(config); + + try + { + // Get Conversation History + ConversationHistory result = apiInstance.GetConversationHistory(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling MemoryApi.GetConversationHistory: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetConversationHistoryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Conversation History + ApiResponse response = apiInstance.GetConversationHistoryWithHttpInfo(); + 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 MemoryApi.GetConversationHistoryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**ConversationHistory**](ConversationHistory.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **RecallMemoriesFromText** +> MemoryRecall RecallMemoriesFromText (string text, int? k = null) + +Recall Memories From Text + +Search k memories similar to given text. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class RecallMemoriesFromTextExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new MemoryApi(config); + var text = "text_example"; // string | Find memories similar to this text. + var k = 100; // int? | How many memories to return. (optional) (default to 100) + + try + { + // Recall Memories From Text + MemoryRecall result = apiInstance.RecallMemoriesFromText(text, k); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling MemoryApi.RecallMemoriesFromText: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RecallMemoriesFromTextWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Recall Memories From Text + ApiResponse response = apiInstance.RecallMemoriesFromTextWithHttpInfo(text, k); + 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 MemoryApi.RecallMemoriesFromTextWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **text** | **string** | Find memories similar to this text. | | +| **k** | **int?** | How many memories to return. | [optional] [default to 100] | + +### Return type + +[**MemoryRecall**](MemoryRecall.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **WipeCollections** +> List<string> WipeCollections () + +Wipe Collections + +Delete and create all collections + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class WipeCollectionsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new MemoryApi(config); + + try + { + // Wipe Collections + List result = apiInstance.WipeCollections(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling MemoryApi.WipeCollections: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the WipeCollectionsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Wipe Collections + ApiResponse> response = apiInstance.WipeCollectionsWithHttpInfo(); + 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 MemoryApi.WipeCollectionsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **WipeConversationHistory** +> List<string> WipeConversationHistory () + +Wipe Conversation History + +Delete the specified user's conversation history from working memory + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class WipeConversationHistoryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new MemoryApi(config); + + try + { + // Wipe Conversation History + List result = apiInstance.WipeConversationHistory(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling MemoryApi.WipeConversationHistory: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the WipeConversationHistoryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Wipe Conversation History + ApiResponse> response = apiInstance.WipeConversationHistoryWithHttpInfo(); + 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 MemoryApi.WipeConversationHistoryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **WipeMemoryPoints** +> List<string> WipeMemoryPoints (string collectionId, Object? body = null) + +Wipe Memory Points By Metadata + +Delete points in memory by filter + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class WipeMemoryPointsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new MemoryApi(config); + var collectionId = "collectionId_example"; // string | + var body = null; // Object? | (optional) + + try + { + // Wipe Memory Points By Metadata + List result = apiInstance.WipeMemoryPoints(collectionId, body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling MemoryApi.WipeMemoryPoints: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the WipeMemoryPointsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Wipe Memory Points By Metadata + ApiResponse> response = apiInstance.WipeMemoryPointsWithHttpInfo(collectionId, body); + 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 MemoryApi.WipeMemoryPointsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **collectionId** | **string** | | | +| **body** | **Object?** | | [optional] | + +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **WipeSingleCollection** +> List<string> WipeSingleCollection (string collectionId) + +Wipe Single Collection + +Delete and recreate a collection + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class WipeSingleCollectionExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new MemoryApi(config); + var collectionId = "collectionId_example"; // string | + + try + { + // Wipe Single Collection + List result = apiInstance.WipeSingleCollection(collectionId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling MemoryApi.WipeSingleCollection: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the WipeSingleCollectionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Wipe Single Collection + ApiResponse> response = apiInstance.WipeSingleCollectionWithHttpInfo(collectionId); + 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 MemoryApi.WipeSingleCollectionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **collectionId** | **string** | | | + +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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/docs/MemoryRecall.md b/docs/MemoryRecall.md new file mode 100644 index 0000000..fabd382 --- /dev/null +++ b/docs/MemoryRecall.md @@ -0,0 +1,11 @@ +# CheshireCatApi.Model.MemoryRecall + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Query** | [**QueryData**](QueryData.md) | | +**Vectors** | [**VectorsData**](VectorsData.md) | | + +[[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/docs/MetaData.md b/docs/MetaData.md new file mode 100644 index 0000000..42be342 --- /dev/null +++ b/docs/MetaData.md @@ -0,0 +1,13 @@ +# CheshireCatApi.Model.MetaData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Source** | **string** | | +**When** | **int** | | +**Docstring** | **string** | | [optional] +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/Plugin.md b/docs/Plugin.md new file mode 100644 index 0000000..d8f915a --- /dev/null +++ b/docs/Plugin.md @@ -0,0 +1,23 @@ +# CheshireCatApi.Model.Plugin + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Name** | **string** | | +**Description** | **string** | | +**AuthorName** | **string** | | +**AuthorUrl** | **string** | | +**PluginUrl** | **string** | | +**Tags** | **string** | | +**Thumb** | **string** | | +**VarVersion** | **string** | | +**Active** | **bool** | | [optional] +**Url** | **string** | | [optional] +**Upgrade** | **string** | | [optional] +**Hooks** | [**List<HooksInner>**](HooksInner.md) | | [optional] +**Tools** | [**List<ToolsInner>**](ToolsInner.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/docs/PluginsApi.md b/docs/PluginsApi.md new file mode 100644 index 0000000..acfde24 --- /dev/null +++ b/docs/PluginsApi.md @@ -0,0 +1,839 @@ +# CheshireCatApi.Api.PluginsApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**DeletePlugin**](PluginsApi.md#deleteplugin) | **DELETE** /plugins/{plugin_id} | Delete Plugin | +| [**GetPluginDetails**](PluginsApi.md#getplugindetails) | **GET** /plugins/{plugin_id} | Get Plugin Details | +| [**GetPluginSettings**](PluginsApi.md#getpluginsettings) | **GET** /plugins/settings/{plugin_id} | Get Plugin Settings | +| [**GetPluginsSettings**](PluginsApi.md#getpluginssettings) | **GET** /plugins/settings | Get Plugins Settings | +| [**InstallPlugin**](PluginsApi.md#installplugin) | **POST** /plugins/upload | Install Plugin | +| [**InstallPluginFromRegistry**](PluginsApi.md#installpluginfromregistry) | **POST** /plugins/upload/registry | Install Plugin From Registry | +| [**ListAvailablePlugins**](PluginsApi.md#listavailableplugins) | **GET** /plugins | List Available Plugins | +| [**TogglePlugin**](PluginsApi.md#toggleplugin) | **PUT** /plugins/toggle/{plugin_id} | Toggle Plugin | +| [**UpsertPluginSettings**](PluginsApi.md#upsertpluginsettings) | **PUT** /plugins/settings/{plugin_id} | Upsert Plugin Settings | + + +# **DeletePlugin** +> List<string> DeletePlugin (string pluginId) + +Delete Plugin + +Physically remove a plugin + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class DeletePluginExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new PluginsApi(config); + var pluginId = "pluginId_example"; // string | + + try + { + // Delete Plugin + List result = apiInstance.DeletePlugin(pluginId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PluginsApi.DeletePlugin: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeletePluginWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete Plugin + ApiResponse> response = apiInstance.DeletePluginWithHttpInfo(pluginId); + 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 PluginsApi.DeletePluginWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pluginId** | **string** | | | + +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **GetPluginDetails** +> Plugin GetPluginDetails (string pluginId) + +Get Plugin Details + +Returns information on a single plugin + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class GetPluginDetailsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new PluginsApi(config); + var pluginId = "pluginId_example"; // string | + + try + { + // Get Plugin Details + Plugin result = apiInstance.GetPluginDetails(pluginId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PluginsApi.GetPluginDetails: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetPluginDetailsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Plugin Details + ApiResponse response = apiInstance.GetPluginDetailsWithHttpInfo(pluginId); + 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 PluginsApi.GetPluginDetailsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pluginId** | **string** | | | + +### Return type + +[**Plugin**](Plugin.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **GetPluginSettings** +> GetPluginSettings200Response GetPluginSettings (string pluginId) + +Get Plugin Settings + +Returns the settings of a specific plugin + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class GetPluginSettingsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new PluginsApi(config); + var pluginId = "pluginId_example"; // string | + + try + { + // Get Plugin Settings + GetPluginSettings200Response result = apiInstance.GetPluginSettings(pluginId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PluginsApi.GetPluginSettings: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetPluginSettingsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Plugin Settings + ApiResponse response = apiInstance.GetPluginSettingsWithHttpInfo(pluginId); + 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 PluginsApi.GetPluginSettingsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pluginId** | **string** | | | + +### Return type + +[**GetPluginSettings200Response**](GetPluginSettings200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **GetPluginsSettings** +> SettingsResponse GetPluginsSettings () + +Get Plugins Settings + +Returns the settings of all the plugins + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class GetPluginsSettingsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new PluginsApi(config); + + try + { + // Get Plugins Settings + SettingsResponse result = apiInstance.GetPluginsSettings(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PluginsApi.GetPluginsSettings: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetPluginsSettingsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Plugins Settings + ApiResponse response = apiInstance.GetPluginsSettingsWithHttpInfo(); + 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 PluginsApi.GetPluginsSettingsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**SettingsResponse**](SettingsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **InstallPlugin** +> FileResponse InstallPlugin (System.IO.Stream file) + +Install Plugin + +Install a new plugin from a zip file + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class InstallPluginExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new PluginsApi(config); + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | + + try + { + // Install Plugin + FileResponse result = apiInstance.InstallPlugin(file); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PluginsApi.InstallPlugin: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the InstallPluginWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Install Plugin + ApiResponse response = apiInstance.InstallPluginWithHttpInfo(file); + 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 PluginsApi.InstallPluginWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **file** | **System.IO.Stream****System.IO.Stream** | | | + +### Return type + +[**FileResponse**](FileResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **InstallPluginFromRegistry** +> FileResponse InstallPluginFromRegistry (BodyUploadUrl bodyUploadUrl) + +Install Plugin From Registry + +Install a new plugin from external repository + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class InstallPluginFromRegistryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new PluginsApi(config); + var bodyUploadUrl = new BodyUploadUrl(); // BodyUploadUrl | + + try + { + // Install Plugin From Registry + FileResponse result = apiInstance.InstallPluginFromRegistry(bodyUploadUrl); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PluginsApi.InstallPluginFromRegistry: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the InstallPluginFromRegistryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Install Plugin From Registry + ApiResponse response = apiInstance.InstallPluginFromRegistryWithHttpInfo(bodyUploadUrl); + 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 PluginsApi.InstallPluginFromRegistryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **bodyUploadUrl** | [**BodyUploadUrl**](BodyUploadUrl.md) | | | + +### Return type + +[**FileResponse**](FileResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **ListAvailablePlugins** +> PluginsList ListAvailablePlugins (string? query = null) + +List Available Plugins + +List both installed and registry plugins + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class ListAvailablePluginsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new PluginsApi(config); + var query = "query_example"; // string? | (optional) + + try + { + // List Available Plugins + PluginsList result = apiInstance.ListAvailablePlugins(query); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PluginsApi.ListAvailablePlugins: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the ListAvailablePluginsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List Available Plugins + ApiResponse response = apiInstance.ListAvailablePluginsWithHttpInfo(query); + 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 PluginsApi.ListAvailablePluginsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **query** | **string?** | | [optional] | + +### Return type + +[**PluginsList**](PluginsList.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TogglePlugin** +> ToggleResponse TogglePlugin (string pluginId) + +Toggle Plugin + +Enable or disable a single plugin + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class TogglePluginExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new PluginsApi(config); + var pluginId = "pluginId_example"; // string | + + try + { + // Toggle Plugin + ToggleResponse result = apiInstance.TogglePlugin(pluginId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PluginsApi.TogglePlugin: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TogglePluginWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Toggle Plugin + ApiResponse response = apiInstance.TogglePluginWithHttpInfo(pluginId); + 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 PluginsApi.TogglePluginWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pluginId** | **string** | | | + +### Return type + +[**ToggleResponse**](ToggleResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **UpsertPluginSettings** +> Setting UpsertPluginSettings (string pluginId, Object body) + +Upsert Plugin Settings + +Updates the settings of a specific plugin + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class UpsertPluginSettingsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new PluginsApi(config); + var pluginId = "pluginId_example"; // string | + var body = {"setting_a":"some value","setting_b":"another value"}; // Object | + + try + { + // Upsert Plugin Settings + Setting result = apiInstance.UpsertPluginSettings(pluginId, body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PluginsApi.UpsertPluginSettings: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpsertPluginSettingsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Upsert Plugin Settings + ApiResponse response = apiInstance.UpsertPluginSettingsWithHttpInfo(pluginId, body); + 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 PluginsApi.UpsertPluginSettingsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pluginId** | **string** | | | +| **body** | **Object** | | | + +### Return type + +[**Setting**](Setting.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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/docs/PluginsList.md b/docs/PluginsList.md new file mode 100644 index 0000000..81acf1d --- /dev/null +++ b/docs/PluginsList.md @@ -0,0 +1,12 @@ +# CheshireCatApi.Model.PluginsList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Filters** | [**Filters**](Filters.md) | | +**Installed** | [**List<Plugin>**](Plugin.md) | | +**Registry** | [**List<Plugin>**](Plugin.md) | | + +[[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/docs/QueryData.md b/docs/QueryData.md new file mode 100644 index 0000000..cf199bd --- /dev/null +++ b/docs/QueryData.md @@ -0,0 +1,11 @@ +# CheshireCatApi.Model.QueryData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Text** | **string** | | +**Vector** | **List<int>** | | + +[[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/docs/RabbitHoleApi.md b/docs/RabbitHoleApi.md new file mode 100644 index 0000000..f26a561 --- /dev/null +++ b/docs/RabbitHoleApi.md @@ -0,0 +1,373 @@ +# CheshireCatApi.Api.RabbitHoleApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**GetAllowedMimetypes**](RabbitHoleApi.md#getallowedmimetypes) | **GET** /rabbithole/allowed-mimetypes | Get Allowed Mimetypes | +| [**UploadFile**](RabbitHoleApi.md#uploadfile) | **POST** /rabbithole | Upload File | +| [**UploadMemory**](RabbitHoleApi.md#uploadmemory) | **POST** /rabbithole/memory | Upload Memory | +| [**UploadUrl**](RabbitHoleApi.md#uploadurl) | **POST** /rabbithole/web | Upload URL | + + +# **GetAllowedMimetypes** +> ResponseGetAllowedMimetypes GetAllowedMimetypes () + +Get Allowed Mimetypes + +Retrieve the allowed mimetypes that can be ingested by the Rabbit Hole + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class GetAllowedMimetypesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new RabbitHoleApi(config); + + try + { + // Get Allowed Mimetypes + ResponseGetAllowedMimetypes result = apiInstance.GetAllowedMimetypes(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling RabbitHoleApi.GetAllowedMimetypes: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetAllowedMimetypesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Allowed Mimetypes + ApiResponse response = apiInstance.GetAllowedMimetypesWithHttpInfo(); + 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 RabbitHoleApi.GetAllowedMimetypesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**ResponseGetAllowedMimetypes**](ResponseGetAllowedMimetypes.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UploadFile** +> FileResponse UploadFile (System.IO.Stream file) + +Upload File + +Upload a file containing text (.txt, .md, .pdf, etc.). File content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class UploadFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new RabbitHoleApi(config); + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | + + try + { + // Upload File + FileResponse result = apiInstance.UploadFile(file); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling RabbitHoleApi.UploadFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Upload File + ApiResponse response = apiInstance.UploadFileWithHttpInfo(file); + 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 RabbitHoleApi.UploadFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **file** | **System.IO.Stream****System.IO.Stream** | | | + +### Return type + +[**FileResponse**](FileResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **UploadMemory** +> Object UploadMemory (System.IO.Stream file) + +Upload Memory + +Upload a memory json file to the cat memory + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class UploadMemoryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new RabbitHoleApi(config); + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | + + try + { + // Upload Memory + Object result = apiInstance.UploadMemory(file); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling RabbitHoleApi.UploadMemory: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadMemoryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Upload Memory + ApiResponse response = apiInstance.UploadMemoryWithHttpInfo(file); + 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 RabbitHoleApi.UploadMemoryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **file** | **System.IO.Stream****System.IO.Stream** | | | + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **UploadUrl** +> WebResponse UploadUrl (BodyUploadUrl bodyUploadUrl) + +Upload URL + +Upload a URL. Website content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class UploadUrlExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new RabbitHoleApi(config); + var bodyUploadUrl = new BodyUploadUrl(); // BodyUploadUrl | + + try + { + // Upload URL + WebResponse result = apiInstance.UploadUrl(bodyUploadUrl); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling RabbitHoleApi.UploadUrl: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadUrlWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Upload URL + ApiResponse response = apiInstance.UploadUrlWithHttpInfo(bodyUploadUrl); + 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 RabbitHoleApi.UploadUrlWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **bodyUploadUrl** | [**BodyUploadUrl**](BodyUploadUrl.md) | | | + +### Return type + +[**WebResponse**](WebResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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/docs/ResponseGetAllowedMimetypes.md b/docs/ResponseGetAllowedMimetypes.md new file mode 100644 index 0000000..ae6bdb9 --- /dev/null +++ b/docs/ResponseGetAllowedMimetypes.md @@ -0,0 +1,10 @@ +# CheshireCatApi.Model.ResponseGetAllowedMimetypes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Allowed** | **List<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/docs/Setting.md b/docs/Setting.md new file mode 100644 index 0000000..d0f1d00 --- /dev/null +++ b/docs/Setting.md @@ -0,0 +1,12 @@ +# CheshireCatApi.Model.Setting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**Value** | **Object** | | +**Schema** | **Object** | | [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/docs/SettingBody.md b/docs/SettingBody.md new file mode 100644 index 0000000..31dec5b --- /dev/null +++ b/docs/SettingBody.md @@ -0,0 +1,12 @@ +# CheshireCatApi.Model.SettingBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**Value** | **Object** | | +**Category** | **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/docs/SettingsApi.md b/docs/SettingsApi.md new file mode 100644 index 0000000..a732f02 --- /dev/null +++ b/docs/SettingsApi.md @@ -0,0 +1,474 @@ +# CheshireCatApi.Api.SettingsApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**CreateSetting**](SettingsApi.md#createsetting) | **POST** /settings | Create Setting | +| [**DeleteSetting**](SettingsApi.md#deletesetting) | **DELETE** /settings/{settingId} | Delete Setting | +| [**GetSetting**](SettingsApi.md#getsetting) | **GET** /settings/{settingId} | Get Setting | +| [**GetSettings**](SettingsApi.md#getsettings) | **GET** /settings | Get Settings | +| [**UpdateSetting**](SettingsApi.md#updatesetting) | **PUT** /settings/{settingId} | Update Setting | + + +# **CreateSetting** +> Setting CreateSetting (SettingBody settingBody) + +Create Setting + +Create a new setting in the database + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class CreateSettingExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new SettingsApi(config); + var settingBody = new SettingBody(); // SettingBody | + + try + { + // Create Setting + Setting result = apiInstance.CreateSetting(settingBody); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SettingsApi.CreateSetting: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateSettingWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create Setting + ApiResponse response = apiInstance.CreateSettingWithHttpInfo(settingBody); + 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 SettingsApi.CreateSettingWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **settingBody** | [**SettingBody**](SettingBody.md) | | | + +### Return type + +[**Setting**](Setting.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **DeleteSetting** +> Object DeleteSetting (string settingId) + +Delete Setting + +Delete a specific setting in the database + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class DeleteSettingExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new SettingsApi(config); + var settingId = "settingId_example"; // string | + + try + { + // Delete Setting + Object result = apiInstance.DeleteSetting(settingId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SettingsApi.DeleteSetting: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteSettingWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete Setting + ApiResponse response = apiInstance.DeleteSettingWithHttpInfo(settingId); + 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 SettingsApi.DeleteSettingWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **settingId** | **string** | | | + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **GetSetting** +> Setting GetSetting (string settingId) + +Get Setting + +Get the a specific setting from the database + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class GetSettingExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new SettingsApi(config); + var settingId = "settingId_example"; // string | + + try + { + // Get Setting + Setting result = apiInstance.GetSetting(settingId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SettingsApi.GetSetting: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetSettingWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Setting + ApiResponse response = apiInstance.GetSettingWithHttpInfo(settingId); + 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 SettingsApi.GetSettingWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **settingId** | **string** | | | + +### Return type + +[**Setting**](Setting.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **GetSettings** +> SettingsResponse GetSettings (string? search = null) + +Get Settings + +Get the entire list of settings available in the database + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class GetSettingsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new SettingsApi(config); + var search = "\"\""; // string? | The setting to search (optional) (default to "") + + try + { + // Get Settings + SettingsResponse result = apiInstance.GetSettings(search); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SettingsApi.GetSettings: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetSettingsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Settings + ApiResponse response = apiInstance.GetSettingsWithHttpInfo(search); + 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 SettingsApi.GetSettingsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **search** | **string?** | The setting to search | [optional] [default to ""] | + +### Return type + +[**SettingsResponse**](SettingsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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) + + +# **UpdateSetting** +> Setting UpdateSetting (string settingId, SettingBody settingBody) + +Update Setting + +Update a specific setting in the database if it exists + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class UpdateSettingExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new SettingsApi(config); + var settingId = "settingId_example"; // string | + var settingBody = new SettingBody(); // SettingBody | + + try + { + // Update Setting + Setting result = apiInstance.UpdateSetting(settingId, settingBody); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SettingsApi.UpdateSetting: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdateSettingWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Update Setting + ApiResponse response = apiInstance.UpdateSettingWithHttpInfo(settingId, settingBody); + 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 SettingsApi.UpdateSettingWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **settingId** | **string** | | | +| **settingBody** | [**SettingBody**](SettingBody.md) | | | + +### Return type + +[**Setting**](Setting.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | +| **422** | Validation 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/docs/SettingsResponse.md b/docs/SettingsResponse.md new file mode 100644 index 0000000..98b12c1 --- /dev/null +++ b/docs/SettingsResponse.md @@ -0,0 +1,11 @@ +# CheshireCatApi.Model.SettingsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Settings** | [**List<Setting>**](Setting.md) | | +**SelectedConfiguration** | **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/docs/Status.md b/docs/Status.md new file mode 100644 index 0000000..907a065 --- /dev/null +++ b/docs/Status.md @@ -0,0 +1,11 @@ +# CheshireCatApi.Model.Status + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarStatus** | **string** | | +**VarVersion** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/StatusApi.md b/docs/StatusApi.md new file mode 100644 index 0000000..3f3734a --- /dev/null +++ b/docs/StatusApi.md @@ -0,0 +1,94 @@ +# CheshireCatApi.Api.StatusApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**Home**](StatusApi.md#home) | **GET** / | Home | + + +# **Home** +> Status Home () + +Home + +Server status + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using CheshireCatApi.Api; +using CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace Example +{ + public class HomeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new StatusApi(config); + + try + { + // Home + Status result = apiInstance.Home(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StatusApi.Home: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HomeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Home + ApiResponse response = apiInstance.HomeWithHttpInfo(); + 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 StatusApi.HomeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**Status**](Status.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful Response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ToggleResponse.md b/docs/ToggleResponse.md new file mode 100644 index 0000000..f42d06b --- /dev/null +++ b/docs/ToggleResponse.md @@ -0,0 +1,10 @@ +# CheshireCatApi.Model.ToggleResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Info** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ToolsInner.md b/docs/ToolsInner.md new file mode 100644 index 0000000..6ba5be6 --- /dev/null +++ b/docs/ToolsInner.md @@ -0,0 +1,10 @@ +# CheshireCatApi.Model.ToolsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/VectorsData.md b/docs/VectorsData.md new file mode 100644 index 0000000..e895ad2 --- /dev/null +++ b/docs/VectorsData.md @@ -0,0 +1,11 @@ +# CheshireCatApi.Model.VectorsData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Embedder** | **string** | | +**Collections** | **Dictionary<string, List<CollectionData>>** | | + +[[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/docs/WebResponse.md b/docs/WebResponse.md new file mode 100644 index 0000000..4860f0d --- /dev/null +++ b/docs/WebResponse.md @@ -0,0 +1,11 @@ +# CheshireCatApi.Model.WebResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | | +**Info** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/dotnet-install.sh b/dotnet-install.sh new file mode 100755 index 0000000..f6b08d1 --- /dev/null +++ b/dotnet-install.sh @@ -0,0 +1,1844 @@ +#!/usr/bin/env bash +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +# Stop script on NZEC +set -e +# Stop script if unbound variable found (use ${var:-} if intentional) +set -u +# By default cmd1 | cmd2 returns exit code of cmd2 regardless of cmd1 success +# This is causing it to fail +set -o pipefail + +# Use in the the functions: eval $invocation +invocation='say_verbose "Calling: ${yellow:-}${FUNCNAME[0]} ${green:-}$*${normal:-}"' + +# standard output may be used as a return value in the functions +# we need a way to write text on the screen in the functions so that +# it won't interfere with the return value. +# Exposing stream 3 as a pipe to standard output of the script itself +exec 3>&1 + +# Setup some colors to use. These need to work in fairly limited shells, like the Ubuntu Docker container where there are only 8 colors. +# See if stdout is a terminal +if [ -t 1 ] && command -v tput > /dev/null; then + # see if it supports colors + ncolors=$(tput colors || echo 0) + if [ -n "$ncolors" ] && [ $ncolors -ge 8 ]; then + bold="$(tput bold || echo)" + normal="$(tput sgr0 || echo)" + black="$(tput setaf 0 || echo)" + red="$(tput setaf 1 || echo)" + green="$(tput setaf 2 || echo)" + yellow="$(tput setaf 3 || echo)" + blue="$(tput setaf 4 || echo)" + magenta="$(tput setaf 5 || echo)" + cyan="$(tput setaf 6 || echo)" + white="$(tput setaf 7 || echo)" + fi +fi + +say_warning() { + printf "%b\n" "${yellow:-}dotnet_install: Warning: $1${normal:-}" >&3 +} + +say_err() { + printf "%b\n" "${red:-}dotnet_install: Error: $1${normal:-}" >&2 +} + +say() { + # using stream 3 (defined in the beginning) to not interfere with stdout of functions + # which may be used as return value + printf "%b\n" "${cyan:-}dotnet-install:${normal:-} $1" >&3 +} + +say_verbose() { + if [ "$verbose" = true ]; then + say "$1" + fi +} + +# This platform list is finite - if the SDK/Runtime has supported Linux distribution-specific assets, +# then and only then should the Linux distribution appear in this list. +# Adding a Linux distribution to this list does not imply distribution-specific support. +get_legacy_os_name_from_platform() { + eval $invocation + + platform="$1" + case "$platform" in + "centos.7") + echo "centos" + return 0 + ;; + "debian.8") + echo "debian" + return 0 + ;; + "debian.9") + echo "debian.9" + return 0 + ;; + "fedora.23") + echo "fedora.23" + return 0 + ;; + "fedora.24") + echo "fedora.24" + return 0 + ;; + "fedora.27") + echo "fedora.27" + return 0 + ;; + "fedora.28") + echo "fedora.28" + return 0 + ;; + "opensuse.13.2") + echo "opensuse.13.2" + return 0 + ;; + "opensuse.42.1") + echo "opensuse.42.1" + return 0 + ;; + "opensuse.42.3") + echo "opensuse.42.3" + return 0 + ;; + "rhel.7"*) + echo "rhel" + return 0 + ;; + "ubuntu.14.04") + echo "ubuntu" + return 0 + ;; + "ubuntu.16.04") + echo "ubuntu.16.04" + return 0 + ;; + "ubuntu.16.10") + echo "ubuntu.16.10" + return 0 + ;; + "ubuntu.18.04") + echo "ubuntu.18.04" + return 0 + ;; + "alpine.3.4.3") + echo "alpine" + return 0 + ;; + esac + return 1 +} + +get_legacy_os_name() { + eval $invocation + + local uname=$(uname) + if [ "$uname" = "Darwin" ]; then + echo "osx" + return 0 + elif [ -n "$runtime_id" ]; then + echo $(get_legacy_os_name_from_platform "${runtime_id%-*}" || echo "${runtime_id%-*}") + return 0 + else + if [ -e /etc/os-release ]; then + . /etc/os-release + os=$(get_legacy_os_name_from_platform "$ID${VERSION_ID:+.${VERSION_ID}}" || echo "") + if [ -n "$os" ]; then + echo "$os" + return 0 + fi + fi + fi + + say_verbose "Distribution specific OS name and version could not be detected: UName = $uname" + return 1 +} + +get_linux_platform_name() { + eval $invocation + + if [ -n "$runtime_id" ]; then + echo "${runtime_id%-*}" + return 0 + else + if [ -e /etc/os-release ]; then + . /etc/os-release + echo "$ID${VERSION_ID:+.${VERSION_ID}}" + return 0 + elif [ -e /etc/redhat-release ]; then + local redhatRelease=$(&1 || true) | grep -q musl +} + +get_current_os_name() { + eval $invocation + + local uname=$(uname) + if [ "$uname" = "Darwin" ]; then + echo "osx" + return 0 + elif [ "$uname" = "FreeBSD" ]; then + echo "freebsd" + return 0 + elif [ "$uname" = "Linux" ]; then + local linux_platform_name="" + linux_platform_name="$(get_linux_platform_name)" || true + + if [ "$linux_platform_name" = "rhel.6" ]; then + echo $linux_platform_name + return 0 + elif is_musl_based_distro; then + echo "linux-musl" + return 0 + elif [ "$linux_platform_name" = "linux-musl" ]; then + echo "linux-musl" + return 0 + else + echo "linux" + return 0 + fi + fi + + say_err "OS name could not be detected: UName = $uname" + return 1 +} + +machine_has() { + eval $invocation + + command -v "$1" > /dev/null 2>&1 + return $? +} + +check_min_reqs() { + local hasMinimum=false + if machine_has "curl"; then + hasMinimum=true + elif machine_has "wget"; then + hasMinimum=true + fi + + if [ "$hasMinimum" = "false" ]; then + say_err "curl (recommended) or wget are required to download dotnet. Install missing prerequisite to proceed." + return 1 + fi + return 0 +} + +# args: +# input - $1 +to_lowercase() { + #eval $invocation + + echo "$1" | tr '[:upper:]' '[:lower:]' + return 0 +} + +# args: +# input - $1 +remove_trailing_slash() { + #eval $invocation + + local input="${1:-}" + echo "${input%/}" + return 0 +} + +# args: +# input - $1 +remove_beginning_slash() { + #eval $invocation + + local input="${1:-}" + echo "${input#/}" + return 0 +} + +# args: +# root_path - $1 +# child_path - $2 - this parameter can be empty +combine_paths() { + eval $invocation + + # TODO: Consider making it work with any number of paths. For now: + if [ ! -z "${3:-}" ]; then + say_err "combine_paths: Function takes two parameters." + return 1 + fi + + local root_path="$(remove_trailing_slash "$1")" + local child_path="$(remove_beginning_slash "${2:-}")" + say_verbose "combine_paths: root_path=$root_path" + say_verbose "combine_paths: child_path=$child_path" + echo "$root_path/$child_path" + return 0 +} + +get_machine_architecture() { + eval $invocation + + if command -v uname > /dev/null; then + CPUName=$(uname -m) + case $CPUName in + armv*l) + echo "arm" + return 0 + ;; + aarch64|arm64) + if [ "$(getconf LONG_BIT)" -lt 64 ]; then + # This is 32-bit OS running on 64-bit CPU (for example Raspberry Pi OS) + echo "arm" + return 0 + fi + echo "arm64" + return 0 + ;; + s390x) + echo "s390x" + return 0 + ;; + ppc64le) + echo "ppc64le" + return 0 + ;; + loongarch64) + echo "loongarch64" + return 0 + ;; + esac + fi + + # Always default to 'x64' + echo "x64" + return 0 +} + +# args: +# architecture - $1 +get_normalized_architecture_from_architecture() { + eval $invocation + + local architecture="$(to_lowercase "$1")" + + if [[ $architecture == \ ]]; then + echo "$(get_machine_architecture)" + return 0 + fi + + case "$architecture" in + amd64|x64) + echo "x64" + return 0 + ;; + arm) + echo "arm" + return 0 + ;; + arm64) + echo "arm64" + return 0 + ;; + s390x) + echo "s390x" + return 0 + ;; + ppc64le) + echo "ppc64le" + return 0 + ;; + loongarch64) + echo "loongarch64" + return 0 + ;; + esac + + say_err "Architecture \`$architecture\` not supported. If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues" + return 1 +} + +# args: +# version - $1 +# channel - $2 +# architecture - $3 +get_normalized_architecture_for_specific_sdk_version() { + eval $invocation + + local is_version_support_arm64="$(is_arm64_supported "$1")" + local is_channel_support_arm64="$(is_arm64_supported "$2")" + local architecture="$3"; + local osname="$(get_current_os_name)" + + if [ "$osname" == "osx" ] && [ "$architecture" == "arm64" ] && { [ "$is_version_support_arm64" = false ] || [ "$is_channel_support_arm64" = false ]; }; then + #check if rosetta is installed + if [ "$(/usr/bin/pgrep oahd >/dev/null 2>&1;echo $?)" -eq 0 ]; then + say_verbose "Changing user architecture from '$architecture' to 'x64' because .NET SDKs prior to version 6.0 do not support arm64." + echo "x64" + return 0; + else + say_err "Architecture \`$architecture\` is not supported for .NET SDK version \`$version\`. Please install Rosetta to allow emulation of the \`$architecture\` .NET SDK on this platform" + return 1 + fi + fi + + echo "$architecture" + return 0 +} + +# args: +# version or channel - $1 +is_arm64_supported() { + #any channel or version that starts with the specified versions + case "$1" in + ( "1"* | "2"* | "3"* | "4"* | "5"*) + echo false + return 0 + esac + + echo true + return 0 +} + +# args: +# user_defined_os - $1 +get_normalized_os() { + eval $invocation + + local osname="$(to_lowercase "$1")" + if [ ! -z "$osname" ]; then + case "$osname" in + osx | freebsd | rhel.6 | linux-musl | linux) + echo "$osname" + return 0 + ;; + macos) + osname='osx' + echo "$osname" + return 0 + ;; + *) + say_err "'$user_defined_os' is not a supported value for --os option, supported values are: osx, macos, linux, linux-musl, freebsd, rhel.6. If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues." + return 1 + ;; + esac + else + osname="$(get_current_os_name)" || return 1 + fi + echo "$osname" + return 0 +} + +# args: +# quality - $1 +get_normalized_quality() { + eval $invocation + + local quality="$(to_lowercase "$1")" + if [ ! -z "$quality" ]; then + case "$quality" in + daily | signed | validated | preview) + echo "$quality" + return 0 + ;; + ga) + #ga quality is available without specifying quality, so normalizing it to empty + return 0 + ;; + *) + say_err "'$quality' is not a supported value for --quality option. Supported values are: daily, signed, validated, preview, ga. If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues." + return 1 + ;; + esac + fi + return 0 +} + +# args: +# channel - $1 +get_normalized_channel() { + eval $invocation + + local channel="$(to_lowercase "$1")" + + if [[ $channel == current ]]; then + say_warning 'Value "Current" is deprecated for -Channel option. Use "STS" instead.' + fi + + if [[ $channel == release/* ]]; then + say_warning 'Using branch name with -Channel option is no longer supported with newer releases. Use -Quality option with a channel in X.Y format instead.'; + fi + + if [ ! -z "$channel" ]; then + case "$channel" in + lts) + echo "LTS" + return 0 + ;; + sts) + echo "STS" + return 0 + ;; + current) + echo "STS" + return 0 + ;; + *) + echo "$channel" + return 0 + ;; + esac + fi + + return 0 +} + +# args: +# runtime - $1 +get_normalized_product() { + eval $invocation + + local product="" + local runtime="$(to_lowercase "$1")" + if [[ "$runtime" == "dotnet" ]]; then + product="dotnet-runtime" + elif [[ "$runtime" == "aspnetcore" ]]; then + product="aspnetcore-runtime" + elif [ -z "$runtime" ]; then + product="dotnet-sdk" + fi + echo "$product" + return 0 +} + +# The version text returned from the feeds is a 1-line or 2-line string: +# For the SDK and the dotnet runtime (2 lines): +# Line 1: # commit_hash +# Line 2: # 4-part version +# For the aspnetcore runtime (1 line): +# Line 1: # 4-part version + +# args: +# version_text - stdin +get_version_from_latestversion_file_content() { + eval $invocation + + cat | tail -n 1 | sed 's/\r$//' + return 0 +} + +# args: +# install_root - $1 +# relative_path_to_package - $2 +# specific_version - $3 +is_dotnet_package_installed() { + eval $invocation + + local install_root="$1" + local relative_path_to_package="$2" + local specific_version="${3//[$'\t\r\n']}" + + local dotnet_package_path="$(combine_paths "$(combine_paths "$install_root" "$relative_path_to_package")" "$specific_version")" + say_verbose "is_dotnet_package_installed: dotnet_package_path=$dotnet_package_path" + + if [ -d "$dotnet_package_path" ]; then + return 0 + else + return 1 + fi +} + +# args: +# downloaded file - $1 +# remote_file_size - $2 +validate_remote_local_file_sizes() +{ + eval $invocation + + local downloaded_file="$1" + local remote_file_size="$2" + local file_size='' + + if [[ "$OSTYPE" == "linux-gnu"* ]]; then + file_size="$(stat -c '%s' "$downloaded_file")" + elif [[ "$OSTYPE" == "darwin"* ]]; then + # hardcode in order to avoid conflicts with GNU stat + file_size="$(/usr/bin/stat -f '%z' "$downloaded_file")" + fi + + if [ -n "$file_size" ]; then + say "Downloaded file size is $file_size bytes." + + if [ -n "$remote_file_size" ] && [ -n "$file_size" ]; then + if [ "$remote_file_size" -ne "$file_size" ]; then + say "The remote and local file sizes are not equal. The remote file size is $remote_file_size bytes and the local size is $file_size bytes. The local package may be corrupted." + else + say "The remote and local file sizes are equal." + fi + fi + + else + say "Either downloaded or local package size can not be measured. One of them may be corrupted." + fi +} + +# args: +# azure_feed - $1 +# channel - $2 +# normalized_architecture - $3 +get_version_from_latestversion_file() { + eval $invocation + + local azure_feed="$1" + local channel="$2" + local normalized_architecture="$3" + + local version_file_url=null + if [[ "$runtime" == "dotnet" ]]; then + version_file_url="$azure_feed/Runtime/$channel/latest.version" + elif [[ "$runtime" == "aspnetcore" ]]; then + version_file_url="$azure_feed/aspnetcore/Runtime/$channel/latest.version" + elif [ -z "$runtime" ]; then + version_file_url="$azure_feed/Sdk/$channel/latest.version" + else + say_err "Invalid value for \$runtime" + return 1 + fi + say_verbose "get_version_from_latestversion_file: latest url: $version_file_url" + + download "$version_file_url" || return $? + return 0 +} + +# args: +# json_file - $1 +parse_globaljson_file_for_version() { + eval $invocation + + local json_file="$1" + if [ ! -f "$json_file" ]; then + say_err "Unable to find \`$json_file\`" + return 1 + fi + + sdk_section=$(cat $json_file | tr -d "\r" | awk '/"sdk"/,/}/') + if [ -z "$sdk_section" ]; then + say_err "Unable to parse the SDK node in \`$json_file\`" + return 1 + fi + + sdk_list=$(echo $sdk_section | awk -F"[{}]" '{print $2}') + sdk_list=${sdk_list//[\" ]/} + sdk_list=${sdk_list//,/$'\n'} + + local version_info="" + while read -r line; do + IFS=: + while read -r key value; do + if [[ "$key" == "version" ]]; then + version_info=$value + fi + done <<< "$line" + done <<< "$sdk_list" + if [ -z "$version_info" ]; then + say_err "Unable to find the SDK:version node in \`$json_file\`" + return 1 + fi + + unset IFS; + echo "$version_info" + return 0 +} + +# args: +# azure_feed - $1 +# channel - $2 +# normalized_architecture - $3 +# version - $4 +# json_file - $5 +get_specific_version_from_version() { + eval $invocation + + local azure_feed="$1" + local channel="$2" + local normalized_architecture="$3" + local version="$(to_lowercase "$4")" + local json_file="$5" + + if [ -z "$json_file" ]; then + if [[ "$version" == "latest" ]]; then + local version_info + version_info="$(get_version_from_latestversion_file "$azure_feed" "$channel" "$normalized_architecture" false)" || return 1 + say_verbose "get_specific_version_from_version: version_info=$version_info" + echo "$version_info" | get_version_from_latestversion_file_content + return 0 + else + echo "$version" + return 0 + fi + else + local version_info + version_info="$(parse_globaljson_file_for_version "$json_file")" || return 1 + echo "$version_info" + return 0 + fi +} + +# args: +# azure_feed - $1 +# channel - $2 +# normalized_architecture - $3 +# specific_version - $4 +# normalized_os - $5 +construct_download_link() { + eval $invocation + + local azure_feed="$1" + local channel="$2" + local normalized_architecture="$3" + local specific_version="${4//[$'\t\r\n']}" + local specific_product_version="$(get_specific_product_version "$1" "$4")" + local osname="$5" + + local download_link=null + if [[ "$runtime" == "dotnet" ]]; then + download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_product_version-$osname-$normalized_architecture.tar.gz" + elif [[ "$runtime" == "aspnetcore" ]]; then + download_link="$azure_feed/aspnetcore/Runtime/$specific_version/aspnetcore-runtime-$specific_product_version-$osname-$normalized_architecture.tar.gz" + elif [ -z "$runtime" ]; then + download_link="$azure_feed/Sdk/$specific_version/dotnet-sdk-$specific_product_version-$osname-$normalized_architecture.tar.gz" + else + return 1 + fi + + echo "$download_link" + return 0 +} + +# args: +# azure_feed - $1 +# specific_version - $2 +# download link - $3 (optional) +get_specific_product_version() { + # If we find a 'productVersion.txt' at the root of any folder, we'll use its contents + # to resolve the version of what's in the folder, superseding the specified version. + # if 'productVersion.txt' is missing but download link is already available, product version will be taken from download link + eval $invocation + + local azure_feed="$1" + local specific_version="${2//[$'\t\r\n']}" + local package_download_link="" + if [ $# -gt 2 ]; then + local package_download_link="$3" + fi + local specific_product_version=null + + # Try to get the version number, using the productVersion.txt file located next to the installer file. + local download_links=($(get_specific_product_version_url "$azure_feed" "$specific_version" true "$package_download_link") + $(get_specific_product_version_url "$azure_feed" "$specific_version" false "$package_download_link")) + + for download_link in "${download_links[@]}" + do + say_verbose "Checking for the existence of $download_link" + + if machine_has "curl" + then + if ! specific_product_version=$(curl -s --fail "${download_link}${feed_credential}" 2>&1); then + continue + else + echo "${specific_product_version//[$'\t\r\n']}" + return 0 + fi + + elif machine_has "wget" + then + specific_product_version=$(wget -qO- "${download_link}${feed_credential}" 2>&1) + if [ $? = 0 ]; then + echo "${specific_product_version//[$'\t\r\n']}" + return 0 + fi + fi + done + + # Getting the version number with productVersion.txt has failed. Try parsing the download link for a version number. + say_verbose "Failed to get the version using productVersion.txt file. Download link will be parsed instead." + specific_product_version="$(get_product_specific_version_from_download_link "$package_download_link" "$specific_version")" + echo "${specific_product_version//[$'\t\r\n']}" + return 0 +} + +# args: +# azure_feed - $1 +# specific_version - $2 +# is_flattened - $3 +# download link - $4 (optional) +get_specific_product_version_url() { + eval $invocation + + local azure_feed="$1" + local specific_version="$2" + local is_flattened="$3" + local package_download_link="" + if [ $# -gt 3 ]; then + local package_download_link="$4" + fi + + local pvFileName="productVersion.txt" + if [ "$is_flattened" = true ]; then + if [ -z "$runtime" ]; then + pvFileName="sdk-productVersion.txt" + elif [[ "$runtime" == "dotnet" ]]; then + pvFileName="runtime-productVersion.txt" + else + pvFileName="$runtime-productVersion.txt" + fi + fi + + local download_link=null + + if [ -z "$package_download_link" ]; then + if [[ "$runtime" == "dotnet" ]]; then + download_link="$azure_feed/Runtime/$specific_version/${pvFileName}" + elif [[ "$runtime" == "aspnetcore" ]]; then + download_link="$azure_feed/aspnetcore/Runtime/$specific_version/${pvFileName}" + elif [ -z "$runtime" ]; then + download_link="$azure_feed/Sdk/$specific_version/${pvFileName}" + else + return 1 + fi + else + download_link="${package_download_link%/*}/${pvFileName}" + fi + + say_verbose "Constructed productVersion link: $download_link" + echo "$download_link" + return 0 +} + +# args: +# download link - $1 +# specific version - $2 +get_product_specific_version_from_download_link() +{ + eval $invocation + + local download_link="$1" + local specific_version="$2" + local specific_product_version="" + + if [ -z "$download_link" ]; then + echo "$specific_version" + return 0 + fi + + #get filename + filename="${download_link##*/}" + + #product specific version follows the product name + #for filename 'dotnet-sdk-3.1.404-linux-x64.tar.gz': the product version is 3.1.404 + IFS='-' + read -ra filename_elems <<< "$filename" + count=${#filename_elems[@]} + if [[ "$count" -gt 2 ]]; then + specific_product_version="${filename_elems[2]}" + else + specific_product_version=$specific_version + fi + unset IFS; + echo "$specific_product_version" + return 0 +} + +# args: +# azure_feed - $1 +# channel - $2 +# normalized_architecture - $3 +# specific_version - $4 +construct_legacy_download_link() { + eval $invocation + + local azure_feed="$1" + local channel="$2" + local normalized_architecture="$3" + local specific_version="${4//[$'\t\r\n']}" + + local distro_specific_osname + distro_specific_osname="$(get_legacy_os_name)" || return 1 + + local legacy_download_link=null + if [[ "$runtime" == "dotnet" ]]; then + legacy_download_link="$azure_feed/Runtime/$specific_version/dotnet-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz" + elif [ -z "$runtime" ]; then + legacy_download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz" + else + return 1 + fi + + echo "$legacy_download_link" + return 0 +} + +get_user_install_path() { + eval $invocation + + if [ ! -z "${DOTNET_INSTALL_DIR:-}" ]; then + echo "$DOTNET_INSTALL_DIR" + else + echo "$HOME/.dotnet" + fi + return 0 +} + +# args: +# install_dir - $1 +resolve_installation_path() { + eval $invocation + + local install_dir=$1 + if [ "$install_dir" = "" ]; then + local user_install_path="$(get_user_install_path)" + say_verbose "resolve_installation_path: user_install_path=$user_install_path" + echo "$user_install_path" + return 0 + fi + + echo "$install_dir" + return 0 +} + +# args: +# relative_or_absolute_path - $1 +get_absolute_path() { + eval $invocation + + local relative_or_absolute_path=$1 + echo "$(cd "$(dirname "$1")" && pwd -P)/$(basename "$1")" + return 0 +} + +# args: +# input_files - stdin +# root_path - $1 +# out_path - $2 +# override - $3 +copy_files_or_dirs_from_list() { + eval $invocation + + local root_path="$(remove_trailing_slash "$1")" + local out_path="$(remove_trailing_slash "$2")" + local override="$3" + local osname="$(get_current_os_name)" + local override_switch=$( + if [ "$override" = false ]; then + if [ "$osname" = "linux-musl" ]; then + printf -- "-u"; + else + printf -- "-n"; + fi + fi) + + cat | uniq | while read -r file_path; do + local path="$(remove_beginning_slash "${file_path#$root_path}")" + local target="$out_path/$path" + if [ "$override" = true ] || (! ([ -d "$target" ] || [ -e "$target" ])); then + mkdir -p "$out_path/$(dirname "$path")" + if [ -d "$target" ]; then + rm -rf "$target" + fi + cp -R $override_switch "$root_path/$path" "$target" + fi + done +} + +# args: +# zip_uri - $1 +get_remote_file_size() { + local zip_uri="$1" + + if machine_has "curl"; then + file_size=$(curl -sI "$zip_uri" | grep -i content-length | awk '{ num = $2 + 0; print num }') + elif machine_has "wget"; then + file_size=$(wget --spider --server-response -O /dev/null "$zip_uri" 2>&1 | grep -i 'Content-Length:' | awk '{ num = $2 + 0; print num }') + else + say "Neither curl nor wget is available on this system." + return + fi + + if [ -n "$file_size" ]; then + say "Remote file $zip_uri size is $file_size bytes." + echo "$file_size" + else + say_verbose "Content-Length header was not extracted for $zip_uri." + echo "" + fi +} + +# args: +# zip_path - $1 +# out_path - $2 +# remote_file_size - $3 +extract_dotnet_package() { + eval $invocation + + local zip_path="$1" + local out_path="$2" + local remote_file_size="$3" + + local temp_out_path="$(mktemp -d "$temporary_file_template")" + + local failed=false + tar -xzf "$zip_path" -C "$temp_out_path" > /dev/null || failed=true + + local folders_with_version_regex='^.*/[0-9]+\.[0-9]+[^/]+/' + find "$temp_out_path" -type f | grep -Eo "$folders_with_version_regex" | sort | copy_files_or_dirs_from_list "$temp_out_path" "$out_path" false + find "$temp_out_path" -type f | grep -Ev "$folders_with_version_regex" | copy_files_or_dirs_from_list "$temp_out_path" "$out_path" "$override_non_versioned_files" + + validate_remote_local_file_sizes "$zip_path" "$remote_file_size" + + rm -rf "$temp_out_path" + if [ -z ${keep_zip+x} ]; then + rm -f "$zip_path" && say_verbose "Temporary zip file $zip_path was removed" + fi + + if [ "$failed" = true ]; then + say_err "Extraction failed" + return 1 + fi + return 0 +} + +# args: +# remote_path - $1 +# disable_feed_credential - $2 +get_http_header() +{ + eval $invocation + local remote_path="$1" + local disable_feed_credential="$2" + + local failed=false + local response + if machine_has "curl"; then + get_http_header_curl $remote_path $disable_feed_credential || failed=true + elif machine_has "wget"; then + get_http_header_wget $remote_path $disable_feed_credential || failed=true + else + failed=true + fi + if [ "$failed" = true ]; then + say_verbose "Failed to get HTTP header: '$remote_path'." + return 1 + fi + return 0 +} + +# args: +# remote_path - $1 +# disable_feed_credential - $2 +get_http_header_curl() { + eval $invocation + local remote_path="$1" + local disable_feed_credential="$2" + + remote_path_with_credential="$remote_path" + if [ "$disable_feed_credential" = false ]; then + remote_path_with_credential+="$feed_credential" + fi + + curl_options="-I -sSL --retry 5 --retry-delay 2 --connect-timeout 15 " + curl $curl_options "$remote_path_with_credential" 2>&1 || return 1 + return 0 +} + +# args: +# remote_path - $1 +# disable_feed_credential - $2 +get_http_header_wget() { + eval $invocation + local remote_path="$1" + local disable_feed_credential="$2" + local wget_options="-q -S --spider --tries 5 " + + local wget_options_extra='' + + # Test for options that aren't supported on all wget implementations. + if [[ $(wget -h 2>&1 | grep -E 'waitretry|connect-timeout') ]]; then + wget_options_extra="--waitretry 2 --connect-timeout 15 " + else + say "wget extra options are unavailable for this environment" + fi + + remote_path_with_credential="$remote_path" + if [ "$disable_feed_credential" = false ]; then + remote_path_with_credential+="$feed_credential" + fi + + wget $wget_options $wget_options_extra "$remote_path_with_credential" 2>&1 + + return $? +} + +# args: +# remote_path - $1 +# [out_path] - $2 - stdout if not provided +download() { + eval $invocation + + local remote_path="$1" + local out_path="${2:-}" + + if [[ "$remote_path" != "http"* ]]; then + cp "$remote_path" "$out_path" + return $? + fi + + local failed=false + local attempts=0 + while [ $attempts -lt 3 ]; do + attempts=$((attempts+1)) + failed=false + if machine_has "curl"; then + downloadcurl "$remote_path" "$out_path" || failed=true + elif machine_has "wget"; then + downloadwget "$remote_path" "$out_path" || failed=true + else + say_err "Missing dependency: neither curl nor wget was found." + exit 1 + fi + + if [ "$failed" = false ] || [ $attempts -ge 3 ] || { [ ! -z $http_code ] && [ $http_code = "404" ]; }; then + break + fi + + say "Download attempt #$attempts has failed: $http_code $download_error_msg" + say "Attempt #$((attempts+1)) will start in $((attempts*10)) seconds." + sleep $((attempts*10)) + done + + if [ "$failed" = true ]; then + say_verbose "Download failed: $remote_path" + return 1 + fi + return 0 +} + +# Updates global variables $http_code and $download_error_msg +downloadcurl() { + eval $invocation + unset http_code + unset download_error_msg + local remote_path="$1" + local out_path="${2:-}" + # Append feed_credential as late as possible before calling curl to avoid logging feed_credential + # Avoid passing URI with credentials to functions: note, most of them echoing parameters of invocation in verbose output. + local remote_path_with_credential="${remote_path}${feed_credential}" + local curl_options="--retry 20 --retry-delay 2 --connect-timeout 15 -sSL -f --create-dirs " + local curl_exit_code=0; + if [ -z "$out_path" ]; then + curl $curl_options "$remote_path_with_credential" 2>&1 + curl_exit_code=$? + else + curl $curl_options -o "$out_path" "$remote_path_with_credential" 2>&1 + curl_exit_code=$? + fi + + if [ $curl_exit_code -gt 0 ]; then + download_error_msg="Unable to download $remote_path." + # Check for curl timeout codes + if [[ $curl_exit_code == 7 || $curl_exit_code == 28 ]]; then + download_error_msg+=" Failed to reach the server: connection timeout." + else + local disable_feed_credential=false + local response=$(get_http_header_curl $remote_path $disable_feed_credential) + http_code=$( echo "$response" | awk '/^HTTP/{print $2}' | tail -1 ) + if [[ ! -z $http_code && $http_code != 2* ]]; then + download_error_msg+=" Returned HTTP status code: $http_code." + fi + fi + say_verbose "$download_error_msg" + return 1 + fi + return 0 +} + + +# Updates global variables $http_code and $download_error_msg +downloadwget() { + eval $invocation + unset http_code + unset download_error_msg + local remote_path="$1" + local out_path="${2:-}" + # Append feed_credential as late as possible before calling wget to avoid logging feed_credential + local remote_path_with_credential="${remote_path}${feed_credential}" + local wget_options="--tries 20 " + + local wget_options_extra='' + local wget_result='' + + # Test for options that aren't supported on all wget implementations. + if [[ $(wget -h 2>&1 | grep -E 'waitretry|connect-timeout') ]]; then + wget_options_extra="--waitretry 2 --connect-timeout 15 " + else + say "wget extra options are unavailable for this environment" + fi + + if [ -z "$out_path" ]; then + wget -q $wget_options $wget_options_extra -O - "$remote_path_with_credential" 2>&1 + wget_result=$? + else + wget $wget_options $wget_options_extra -O "$out_path" "$remote_path_with_credential" 2>&1 + wget_result=$? + fi + + if [[ $wget_result != 0 ]]; then + local disable_feed_credential=false + local response=$(get_http_header_wget $remote_path $disable_feed_credential) + http_code=$( echo "$response" | awk '/^ HTTP/{print $2}' | tail -1 ) + download_error_msg="Unable to download $remote_path." + if [[ ! -z $http_code && $http_code != 2* ]]; then + download_error_msg+=" Returned HTTP status code: $http_code." + # wget exit code 4 stands for network-issue + elif [[ $wget_result == 4 ]]; then + download_error_msg+=" Failed to reach the server: connection timeout." + fi + say_verbose "$download_error_msg" + return 1 + fi + + return 0 +} + +get_download_link_from_aka_ms() { + eval $invocation + + #quality is not supported for LTS or STS channel + #STS maps to current + if [[ ! -z "$normalized_quality" && ("$normalized_channel" == "LTS" || "$normalized_channel" == "STS") ]]; then + normalized_quality="" + say_warning "Specifying quality for STS or LTS channel is not supported, the quality will be ignored." + fi + + say_verbose "Retrieving primary payload URL from aka.ms for channel: '$normalized_channel', quality: '$normalized_quality', product: '$normalized_product', os: '$normalized_os', architecture: '$normalized_architecture'." + + #construct aka.ms link + aka_ms_link="https://aka.ms/dotnet" + if [ "$internal" = true ]; then + aka_ms_link="$aka_ms_link/internal" + fi + aka_ms_link="$aka_ms_link/$normalized_channel" + if [[ ! -z "$normalized_quality" ]]; then + aka_ms_link="$aka_ms_link/$normalized_quality" + fi + aka_ms_link="$aka_ms_link/$normalized_product-$normalized_os-$normalized_architecture.tar.gz" + say_verbose "Constructed aka.ms link: '$aka_ms_link'." + + #get HTTP response + #do not pass credentials as a part of the $aka_ms_link and do not apply credentials in the get_http_header function + #otherwise the redirect link would have credentials as well + #it would result in applying credentials twice to the resulting link and thus breaking it, and in echoing credentials to the output as a part of redirect link + disable_feed_credential=true + response="$(get_http_header $aka_ms_link $disable_feed_credential)" + + say_verbose "Received response: $response" + # Get results of all the redirects. + http_codes=$( echo "$response" | awk '$1 ~ /^HTTP/ {print $2}' ) + # They all need to be 301, otherwise some links are broken (except for the last, which is not a redirect but 200 or 404). + broken_redirects=$( echo "$http_codes" | sed '$d' | grep -v '301' ) + + # All HTTP codes are 301 (Moved Permanently), the redirect link exists. + if [[ -z "$broken_redirects" ]]; then + aka_ms_download_link=$( echo "$response" | awk '$1 ~ /^Location/{print $2}' | tail -1 | tr -d '\r') + + if [[ -z "$aka_ms_download_link" ]]; then + say_verbose "The aka.ms link '$aka_ms_link' is not valid: failed to get redirect location." + return 1 + fi + + say_verbose "The redirect location retrieved: '$aka_ms_download_link'." + return 0 + else + say_verbose "The aka.ms link '$aka_ms_link' is not valid: received HTTP code: $(echo "$broken_redirects" | paste -sd "," -)." + return 1 + fi +} + +get_feeds_to_use() +{ + feeds=( + "https://dotnetcli.azureedge.net/dotnet" + "https://dotnetbuilds.azureedge.net/public" + ) + + if [[ -n "$azure_feed" ]]; then + feeds=("$azure_feed") + fi + + if [[ "$no_cdn" == "true" ]]; then + feeds=( + "https://dotnetcli.blob.core.windows.net/dotnet" + "https://dotnetbuilds.blob.core.windows.net/public" + ) + + if [[ -n "$uncached_feed" ]]; then + feeds=("$uncached_feed") + fi + fi +} + +# THIS FUNCTION MAY EXIT (if the determined version is already installed). +generate_download_links() { + + download_links=() + specific_versions=() + effective_versions=() + link_types=() + + # If generate_akams_links returns false, no fallback to old links. Just terminate. + # This function may also 'exit' (if the determined version is already installed). + generate_akams_links || return + + # Check other feeds only if we haven't been able to find an aka.ms link. + if [[ "${#download_links[@]}" -lt 1 ]]; then + for feed in ${feeds[@]} + do + # generate_regular_links may also 'exit' (if the determined version is already installed). + generate_regular_links $feed || return + done + fi + + if [[ "${#download_links[@]}" -eq 0 ]]; then + say_err "Failed to resolve the exact version number." + return 1 + fi + + say_verbose "Generated ${#download_links[@]} links." + for link_index in ${!download_links[@]} + do + say_verbose "Link $link_index: ${link_types[$link_index]}, ${effective_versions[$link_index]}, ${download_links[$link_index]}" + done +} + +# THIS FUNCTION MAY EXIT (if the determined version is already installed). +generate_akams_links() { + local valid_aka_ms_link=true; + + normalized_version="$(to_lowercase "$version")" + if [[ "$normalized_version" != "latest" ]] && [ -n "$normalized_quality" ]; then + say_err "Quality and Version options are not allowed to be specified simultaneously. See https://learn.microsoft.com/dotnet/core/tools/dotnet-install-script#options for details." + return 1 + fi + + if [[ -n "$json_file" || "$normalized_version" != "latest" ]]; then + # aka.ms links are not needed when exact version is specified via command or json file + return + fi + + get_download_link_from_aka_ms || valid_aka_ms_link=false + + if [[ "$valid_aka_ms_link" == true ]]; then + say_verbose "Retrieved primary payload URL from aka.ms link: '$aka_ms_download_link'." + say_verbose "Downloading using legacy url will not be attempted." + + download_link=$aka_ms_download_link + + #get version from the path + IFS='/' + read -ra pathElems <<< "$download_link" + count=${#pathElems[@]} + specific_version="${pathElems[count-2]}" + unset IFS; + say_verbose "Version: '$specific_version'." + + #Retrieve effective version + effective_version="$(get_specific_product_version "$azure_feed" "$specific_version" "$download_link")" + + # Add link info to arrays + download_links+=($download_link) + specific_versions+=($specific_version) + effective_versions+=($effective_version) + link_types+=("aka.ms") + + # Check if the SDK version is already installed. + if [[ "$dry_run" != true ]] && is_dotnet_package_installed "$install_root" "$asset_relative_path" "$effective_version"; then + say "$asset_name with version '$effective_version' is already installed." + exit 0 + fi + + return 0 + fi + + # if quality is specified - exit with error - there is no fallback approach + if [ ! -z "$normalized_quality" ]; then + say_err "Failed to locate the latest version in the channel '$normalized_channel' with '$normalized_quality' quality for '$normalized_product', os: '$normalized_os', architecture: '$normalized_architecture'." + say_err "Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support." + return 1 + fi + say_verbose "Falling back to latest.version file approach." +} + +# THIS FUNCTION MAY EXIT (if the determined version is already installed) +# args: +# feed - $1 +generate_regular_links() { + local feed="$1" + local valid_legacy_download_link=true + + specific_version=$(get_specific_version_from_version "$feed" "$channel" "$normalized_architecture" "$version" "$json_file") || specific_version='0' + + if [[ "$specific_version" == '0' ]]; then + say_verbose "Failed to resolve the specific version number using feed '$feed'" + return + fi + + effective_version="$(get_specific_product_version "$feed" "$specific_version")" + say_verbose "specific_version=$specific_version" + + download_link="$(construct_download_link "$feed" "$channel" "$normalized_architecture" "$specific_version" "$normalized_os")" + say_verbose "Constructed primary named payload URL: $download_link" + + # Add link info to arrays + download_links+=($download_link) + specific_versions+=($specific_version) + effective_versions+=($effective_version) + link_types+=("primary") + + legacy_download_link="$(construct_legacy_download_link "$feed" "$channel" "$normalized_architecture" "$specific_version")" || valid_legacy_download_link=false + + if [ "$valid_legacy_download_link" = true ]; then + say_verbose "Constructed legacy named payload URL: $legacy_download_link" + + download_links+=($legacy_download_link) + specific_versions+=($specific_version) + effective_versions+=($effective_version) + link_types+=("legacy") + else + legacy_download_link="" + say_verbose "Cound not construct a legacy_download_link; omitting..." + fi + + # Check if the SDK version is already installed. + if [[ "$dry_run" != true ]] && is_dotnet_package_installed "$install_root" "$asset_relative_path" "$effective_version"; then + say "$asset_name with version '$effective_version' is already installed." + exit 0 + fi +} + +print_dry_run() { + + say "Payload URLs:" + + for link_index in "${!download_links[@]}" + do + say "URL #$link_index - ${link_types[$link_index]}: ${download_links[$link_index]}" + done + + resolved_version=${specific_versions[0]} + repeatable_command="./$script_name --version "\""$resolved_version"\"" --install-dir "\""$install_root"\"" --architecture "\""$normalized_architecture"\"" --os "\""$normalized_os"\""" + + if [ ! -z "$normalized_quality" ]; then + repeatable_command+=" --quality "\""$normalized_quality"\""" + fi + + if [[ "$runtime" == "dotnet" ]]; then + repeatable_command+=" --runtime "\""dotnet"\""" + elif [[ "$runtime" == "aspnetcore" ]]; then + repeatable_command+=" --runtime "\""aspnetcore"\""" + fi + + repeatable_command+="$non_dynamic_parameters" + + if [ -n "$feed_credential" ]; then + repeatable_command+=" --feed-credential "\"""\""" + fi + + say "Repeatable invocation: $repeatable_command" +} + +calculate_vars() { + eval $invocation + + script_name=$(basename "$0") + normalized_architecture="$(get_normalized_architecture_from_architecture "$architecture")" + say_verbose "Normalized architecture: '$normalized_architecture'." + normalized_os="$(get_normalized_os "$user_defined_os")" + say_verbose "Normalized OS: '$normalized_os'." + normalized_quality="$(get_normalized_quality "$quality")" + say_verbose "Normalized quality: '$normalized_quality'." + normalized_channel="$(get_normalized_channel "$channel")" + say_verbose "Normalized channel: '$normalized_channel'." + normalized_product="$(get_normalized_product "$runtime")" + say_verbose "Normalized product: '$normalized_product'." + install_root="$(resolve_installation_path "$install_dir")" + say_verbose "InstallRoot: '$install_root'." + + normalized_architecture="$(get_normalized_architecture_for_specific_sdk_version "$version" "$normalized_channel" "$normalized_architecture")" + + if [[ "$runtime" == "dotnet" ]]; then + asset_relative_path="shared/Microsoft.NETCore.App" + asset_name=".NET Core Runtime" + elif [[ "$runtime" == "aspnetcore" ]]; then + asset_relative_path="shared/Microsoft.AspNetCore.App" + asset_name="ASP.NET Core Runtime" + elif [ -z "$runtime" ]; then + asset_relative_path="sdk" + asset_name=".NET Core SDK" + fi + + get_feeds_to_use +} + +install_dotnet() { + eval $invocation + local download_failed=false + local download_completed=false + local remote_file_size=0 + + mkdir -p "$install_root" + zip_path="${zip_path:-$(mktemp "$temporary_file_template")}" + say_verbose "Zip path: $zip_path" + + for link_index in "${!download_links[@]}" + do + download_link="${download_links[$link_index]}" + specific_version="${specific_versions[$link_index]}" + effective_version="${effective_versions[$link_index]}" + link_type="${link_types[$link_index]}" + + say "Attempting to download using $link_type link $download_link" + + # The download function will set variables $http_code and $download_error_msg in case of failure. + download_failed=false + download "$download_link" "$zip_path" 2>&1 || download_failed=true + + if [ "$download_failed" = true ]; then + case $http_code in + 404) + say "The resource at $link_type link '$download_link' is not available." + ;; + *) + say "Failed to download $link_type link '$download_link': $download_error_msg" + ;; + esac + rm -f "$zip_path" 2>&1 && say_verbose "Temporary zip file $zip_path was removed" + else + download_completed=true + break + fi + done + + if [[ "$download_completed" == false ]]; then + say_err "Could not find \`$asset_name\` with version = $specific_version" + say_err "Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support" + return 1 + fi + + remote_file_size="$(get_remote_file_size "$download_link")" + + say "Extracting zip from $download_link" + extract_dotnet_package "$zip_path" "$install_root" "$remote_file_size" || return 1 + + # Check if the SDK version is installed; if not, fail the installation. + # if the version contains "RTM" or "servicing"; check if a 'release-type' SDK version is installed. + if [[ $specific_version == *"rtm"* || $specific_version == *"servicing"* ]]; then + IFS='-' + read -ra verArr <<< "$specific_version" + release_version="${verArr[0]}" + unset IFS; + say_verbose "Checking installation: version = $release_version" + if is_dotnet_package_installed "$install_root" "$asset_relative_path" "$release_version"; then + say "Installed version is $effective_version" + return 0 + fi + fi + + # Check if the standard SDK version is installed. + say_verbose "Checking installation: version = $effective_version" + if is_dotnet_package_installed "$install_root" "$asset_relative_path" "$effective_version"; then + say "Installed version is $effective_version" + return 0 + fi + + # Version verification failed. More likely something is wrong either with the downloaded content or with the verification algorithm. + say_err "Failed to verify the version of installed \`$asset_name\`.\nInstallation source: $download_link.\nInstallation location: $install_root.\nReport the bug at https://github.com/dotnet/install-scripts/issues." + say_err "\`$asset_name\` with version = $effective_version failed to install with an error." + return 1 +} + +args=("$@") + +local_version_file_relative_path="/.version" +bin_folder_relative_path="" +temporary_file_template="${TMPDIR:-/tmp}/dotnet.XXXXXXXXX" + +channel="LTS" +version="Latest" +json_file="" +install_dir="" +architecture="" +dry_run=false +no_path=false +no_cdn=false +azure_feed="" +uncached_feed="" +feed_credential="" +verbose=false +runtime="" +runtime_id="" +quality="" +internal=false +override_non_versioned_files=true +non_dynamic_parameters="" +user_defined_os="" + +while [ $# -ne 0 ] +do + name="$1" + case "$name" in + -c|--channel|-[Cc]hannel) + shift + channel="$1" + ;; + -v|--version|-[Vv]ersion) + shift + version="$1" + ;; + -q|--quality|-[Qq]uality) + shift + quality="$1" + ;; + --internal|-[Ii]nternal) + internal=true + non_dynamic_parameters+=" $name" + ;; + -i|--install-dir|-[Ii]nstall[Dd]ir) + shift + install_dir="$1" + ;; + --arch|--architecture|-[Aa]rch|-[Aa]rchitecture) + shift + architecture="$1" + ;; + --os|-[Oo][SS]) + shift + user_defined_os="$1" + ;; + --shared-runtime|-[Ss]hared[Rr]untime) + say_warning "The --shared-runtime flag is obsolete and may be removed in a future version of this script. The recommended usage is to specify '--runtime dotnet'." + if [ -z "$runtime" ]; then + runtime="dotnet" + fi + ;; + --runtime|-[Rr]untime) + shift + runtime="$1" + if [[ "$runtime" != "dotnet" ]] && [[ "$runtime" != "aspnetcore" ]]; then + say_err "Unsupported value for --runtime: '$1'. Valid values are 'dotnet' and 'aspnetcore'." + if [[ "$runtime" == "windowsdesktop" ]]; then + say_err "WindowsDesktop archives are manufactured for Windows platforms only." + fi + exit 1 + fi + ;; + --dry-run|-[Dd]ry[Rr]un) + dry_run=true + ;; + --no-path|-[Nn]o[Pp]ath) + no_path=true + non_dynamic_parameters+=" $name" + ;; + --verbose|-[Vv]erbose) + verbose=true + non_dynamic_parameters+=" $name" + ;; + --no-cdn|-[Nn]o[Cc]dn) + no_cdn=true + non_dynamic_parameters+=" $name" + ;; + --azure-feed|-[Aa]zure[Ff]eed) + shift + azure_feed="$1" + non_dynamic_parameters+=" $name "\""$1"\""" + ;; + --uncached-feed|-[Uu]ncached[Ff]eed) + shift + uncached_feed="$1" + non_dynamic_parameters+=" $name "\""$1"\""" + ;; + --feed-credential|-[Ff]eed[Cc]redential) + shift + feed_credential="$1" + #feed_credential should start with "?", for it to be added to the end of the link. + #adding "?" at the beginning of the feed_credential if needed. + [[ -z "$(echo $feed_credential)" ]] || [[ $feed_credential == \?* ]] || feed_credential="?$feed_credential" + ;; + --runtime-id|-[Rr]untime[Ii]d) + shift + runtime_id="$1" + non_dynamic_parameters+=" $name "\""$1"\""" + say_warning "Use of --runtime-id is obsolete and should be limited to the versions below 2.1. To override architecture, use --architecture option instead. To override OS, use --os option instead." + ;; + --jsonfile|-[Jj][Ss]on[Ff]ile) + shift + json_file="$1" + ;; + --skip-non-versioned-files|-[Ss]kip[Nn]on[Vv]ersioned[Ff]iles) + override_non_versioned_files=false + non_dynamic_parameters+=" $name" + ;; + --keep-zip|-[Kk]eep[Zz]ip) + keep_zip=true + non_dynamic_parameters+=" $name" + ;; + --zip-path|-[Zz]ip[Pp]ath) + shift + zip_path="$1" + ;; + -?|--?|-h|--help|-[Hh]elp) + script_name="$(basename "$0")" + echo ".NET Tools Installer" + echo "Usage:" + echo " # Install a .NET SDK of a given Quality from a given Channel" + echo " $script_name [-c|--channel ] [-q|--quality ]" + echo " # Install a .NET SDK of a specific public version" + echo " $script_name [-v|--version ]" + echo " $script_name -h|-?|--help" + echo "" + echo "$script_name is a simple command line interface for obtaining dotnet cli." + echo " Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:" + echo " - The SDK needs to be installed without user interaction and without admin rights." + echo " - The SDK installation doesn't need to persist across multiple CI runs." + echo " To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer." + echo "" + echo "Options:" + echo " -c,--channel Download from the channel specified, Defaults to \`$channel\`." + echo " -Channel" + echo " Possible values:" + echo " - STS - the most recent Standard Term Support release" + echo " - LTS - the most recent Long Term Support release" + echo " - 2-part version in a format A.B - represents a specific release" + echo " examples: 2.0; 1.0" + echo " - 3-part version in a format A.B.Cxx - represents a specific SDK release" + echo " examples: 5.0.1xx, 5.0.2xx." + echo " Supported since 5.0 release" + echo " Warning: Value 'Current' is deprecated for the Channel parameter. Use 'STS' instead." + echo " Note: The version parameter overrides the channel parameter when any version other than 'latest' is used." + echo " -v,--version Use specific VERSION, Defaults to \`$version\`." + echo " -Version" + echo " Possible values:" + echo " - latest - the latest build on specific channel" + echo " - 3-part version in a format A.B.C - represents specific version of build" + echo " examples: 2.0.0-preview2-006120; 1.1.0" + echo " -q,--quality Download the latest build of specified quality in the channel." + echo " -Quality" + echo " The possible values are: daily, signed, validated, preview, GA." + echo " Works only in combination with channel. Not applicable for STS and LTS channels and will be ignored if those channels are used." + echo " For SDK use channel in A.B.Cxx format. Using quality for SDK together with channel in A.B format is not supported." + echo " Supported since 5.0 release." + echo " Note: The version parameter overrides the channel parameter when any version other than 'latest' is used, and therefore overrides the quality." + echo " --internal,-Internal Download internal builds. Requires providing credentials via --feed-credential parameter." + echo " --feed-credential Token to access Azure feed. Used as a query string to append to the Azure feed." + echo " -FeedCredential This parameter typically is not specified." + echo " -i,--install-dir Install under specified location (see Install Location below)" + echo " -InstallDir" + echo " --architecture Architecture of dotnet binaries to be installed, Defaults to \`$architecture\`." + echo " --arch,-Architecture,-Arch" + echo " Possible values: x64, arm, arm64, s390x, ppc64le and loongarch64" + echo " --os Specifies operating system to be used when selecting the installer." + echo " Overrides the OS determination approach used by the script. Supported values: osx, linux, linux-musl, freebsd, rhel.6." + echo " In case any other value is provided, the platform will be determined by the script based on machine configuration." + echo " Not supported for legacy links. Use --runtime-id to specify platform for legacy links." + echo " Refer to: https://aka.ms/dotnet-os-lifecycle for more information." + echo " --runtime Installs a shared runtime only, without the SDK." + echo " -Runtime" + echo " Possible values:" + echo " - dotnet - the Microsoft.NETCore.App shared runtime" + echo " - aspnetcore - the Microsoft.AspNetCore.App shared runtime" + echo " --dry-run,-DryRun Do not perform installation. Display download link." + echo " --no-path, -NoPath Do not set PATH for the current process." + echo " --verbose,-Verbose Display diagnostics information." + echo " --azure-feed,-AzureFeed For internal use only." + echo " Allows using a different storage to download SDK archives from." + echo " This parameter is only used if --no-cdn is false." + echo " --uncached-feed,-UncachedFeed For internal use only." + echo " Allows using a different storage to download SDK archives from." + echo " This parameter is only used if --no-cdn is true." + echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable." + echo " -SkipNonVersionedFiles" + echo " --no-cdn,-NoCdn Disable downloading from the Azure CDN, and use the uncached feed directly." + echo " --jsonfile Determines the SDK version from a user specified global.json file." + echo " Note: global.json must have a value for 'SDK:Version'" + echo " --keep-zip,-KeepZip If set, downloaded file is kept." + echo " --zip-path, -ZipPath If set, downloaded file is stored at the specified path." + echo " -?,--?,-h,--help,-Help Shows this help message" + echo "" + echo "Install Location:" + echo " Location is chosen in following order:" + echo " - --install-dir option" + echo " - Environmental variable DOTNET_INSTALL_DIR" + echo " - $HOME/.dotnet" + exit 0 + ;; + *) + say_err "Unknown argument \`$name\`" + exit 1 + ;; + esac + + shift +done + +say_verbose "Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:" +say_verbose "- The SDK needs to be installed without user interaction and without admin rights." +say_verbose "- The SDK installation doesn't need to persist across multiple CI runs." +say_verbose "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.\n" + +if [ "$internal" = true ] && [ -z "$(echo $feed_credential)" ]; then + message="Provide credentials via --feed-credential parameter." + if [ "$dry_run" = true ]; then + say_warning "$message" + else + say_err "$message" + exit 1 + fi +fi + +check_min_reqs +calculate_vars +# generate_regular_links call below will 'exit' if the determined version is already installed. +generate_download_links + +if [[ "$dry_run" = true ]]; then + print_dry_run + exit 0 +fi + +install_dotnet + +bin_path="$(get_absolute_path "$(combine_paths "$install_root" "$bin_folder_relative_path")")" +if [ "$no_path" = false ]; then + say "Adding to current process PATH: \`$bin_path\`. Note: This change will be visible only when sourcing script." + export PATH="$bin_path":"$PATH" +else + say "Binaries of dotnet can be found in $bin_path" +fi + +say "Note that the script does not resolve dependencies during installation." +say "To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the \"Dependencies\" section." +say "Installation finished successfully." diff --git a/generate_client.sh b/generate_client.sh new file mode 100644 index 0000000..bfb94ed --- /dev/null +++ b/generate_client.sh @@ -0,0 +1,8 @@ +docker run --rm -v "${PWD}":/local openapitools/openapi-generator-cli generate \ +-i /local/catapi.json \ + -g csharp \ + --git-host github.com \ + --git-repo-id api-client-csharp \ + --git-user-id cheshire-cat-ai \ + --package-name CheshireCatApi \ + -o /local/. diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 0000000..1c0240a --- /dev/null +++ b/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="cheshire-cat-ai" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="api-client-csharp" + 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/src/CheshireCatApi.Test/Api/EmbedderApiTests.cs b/src/CheshireCatApi.Test/Api/EmbedderApiTests.cs new file mode 100644 index 0000000..c9bc1ae --- /dev/null +++ b/src/CheshireCatApi.Test/Api/EmbedderApiTests.cs @@ -0,0 +1,93 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.Client; +using CheshireCatApi.Api; +// uncomment below to import models +//using CheshireCatApi.Model; + +namespace CheshireCatApi.Test.Api +{ + /// + /// Class for testing EmbedderApi + /// + /// + /// 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 EmbedderApiTests : IDisposable + { + private EmbedderApi instance; + + public EmbedderApiTests() + { + instance = new EmbedderApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EmbedderApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' EmbedderApi + //Assert.IsType(instance); + } + + /// + /// Test GetEmbedderSettings + /// + [Fact] + public void GetEmbedderSettingsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string languageEmbedderName = null; + //var response = instance.GetEmbedderSettings(languageEmbedderName); + //Assert.IsType(response); + } + + /// + /// Test GetEmbeddersSettings + /// + [Fact] + public void GetEmbeddersSettingsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.GetEmbeddersSettings(); + //Assert.IsType(response); + } + + /// + /// Test UpsertEmbedderSetting + /// + [Fact] + public void UpsertEmbedderSettingTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string languageEmbedderName = null; + //Object body = null; + //var response = instance.UpsertEmbedderSetting(languageEmbedderName, body); + //Assert.IsType(response); + } + } +} diff --git a/src/CheshireCatApi.Test/Api/LargeLanguageModelApiTests.cs b/src/CheshireCatApi.Test/Api/LargeLanguageModelApiTests.cs new file mode 100644 index 0000000..ff86c88 --- /dev/null +++ b/src/CheshireCatApi.Test/Api/LargeLanguageModelApiTests.cs @@ -0,0 +1,93 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.Client; +using CheshireCatApi.Api; +// uncomment below to import models +//using CheshireCatApi.Model; + +namespace CheshireCatApi.Test.Api +{ + /// + /// Class for testing LargeLanguageModelApi + /// + /// + /// 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 LargeLanguageModelApiTests : IDisposable + { + private LargeLanguageModelApi instance; + + public LargeLanguageModelApiTests() + { + instance = new LargeLanguageModelApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LargeLanguageModelApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' LargeLanguageModelApi + //Assert.IsType(instance); + } + + /// + /// Test GetLlmSettings + /// + [Fact] + public void GetLlmSettingsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string languageModelName = null; + //var response = instance.GetLlmSettings(languageModelName); + //Assert.IsType(response); + } + + /// + /// Test GetLlmsSettings + /// + [Fact] + public void GetLlmsSettingsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.GetLlmsSettings(); + //Assert.IsType(response); + } + + /// + /// Test UpsertLlmSetting + /// + [Fact] + public void UpsertLlmSettingTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string languageModelName = null; + //Object body = null; + //var response = instance.UpsertLlmSetting(languageModelName, body); + //Assert.IsType(response); + } + } +} diff --git a/src/CheshireCatApi.Test/Api/MemoryApiTests.cs b/src/CheshireCatApi.Test/Api/MemoryApiTests.cs new file mode 100644 index 0000000..925d93e --- /dev/null +++ b/src/CheshireCatApi.Test/Api/MemoryApiTests.cs @@ -0,0 +1,152 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.Client; +using CheshireCatApi.Api; +// uncomment below to import models +//using CheshireCatApi.Model; + +namespace CheshireCatApi.Test.Api +{ + /// + /// Class for testing MemoryApi + /// + /// + /// 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 MemoryApiTests : IDisposable + { + private MemoryApi instance; + + public MemoryApiTests() + { + instance = new MemoryApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MemoryApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' MemoryApi + //Assert.IsType(instance); + } + + /// + /// Test DeletePointInMemory + /// + [Fact] + public void DeletePointInMemoryTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string collectionId = null; + //string memoryId = null; + //var response = instance.DeletePointInMemory(collectionId, memoryId); + //Assert.IsType>(response); + } + + /// + /// Test GetCollections + /// + [Fact] + public void GetCollectionsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.GetCollections(); + //Assert.IsType(response); + } + + /// + /// Test GetConversationHistory + /// + [Fact] + public void GetConversationHistoryTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.GetConversationHistory(); + //Assert.IsType(response); + } + + /// + /// Test RecallMemoriesFromText + /// + [Fact] + public void RecallMemoriesFromTextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string text = null; + //int? k = null; + //var response = instance.RecallMemoriesFromText(text, k); + //Assert.IsType(response); + } + + /// + /// Test WipeCollections + /// + [Fact] + public void WipeCollectionsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.WipeCollections(); + //Assert.IsType>(response); + } + + /// + /// Test WipeConversationHistory + /// + [Fact] + public void WipeConversationHistoryTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.WipeConversationHistory(); + //Assert.IsType>(response); + } + + /// + /// Test WipeMemoryPoints + /// + [Fact] + public void WipeMemoryPointsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string collectionId = null; + //Object? body = null; + //var response = instance.WipeMemoryPoints(collectionId, body); + //Assert.IsType>(response); + } + + /// + /// Test WipeSingleCollection + /// + [Fact] + public void WipeSingleCollectionTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string collectionId = null; + //var response = instance.WipeSingleCollection(collectionId); + //Assert.IsType>(response); + } + } +} diff --git a/src/CheshireCatApi.Test/Api/PluginsApiTests.cs b/src/CheshireCatApi.Test/Api/PluginsApiTests.cs new file mode 100644 index 0000000..61f4d78 --- /dev/null +++ b/src/CheshireCatApi.Test/Api/PluginsApiTests.cs @@ -0,0 +1,165 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.Client; +using CheshireCatApi.Api; +// uncomment below to import models +//using CheshireCatApi.Model; + +namespace CheshireCatApi.Test.Api +{ + /// + /// Class for testing PluginsApi + /// + /// + /// 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 PluginsApiTests : IDisposable + { + private PluginsApi instance; + + public PluginsApiTests() + { + instance = new PluginsApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of PluginsApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' PluginsApi + //Assert.IsType(instance); + } + + /// + /// Test DeletePlugin + /// + [Fact] + public void DeletePluginTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string pluginId = null; + //var response = instance.DeletePlugin(pluginId); + //Assert.IsType>(response); + } + + /// + /// Test GetPluginDetails + /// + [Fact] + public void GetPluginDetailsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string pluginId = null; + //var response = instance.GetPluginDetails(pluginId); + //Assert.IsType(response); + } + + /// + /// Test GetPluginSettings + /// + [Fact] + public void GetPluginSettingsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string pluginId = null; + //var response = instance.GetPluginSettings(pluginId); + //Assert.IsType(response); + } + + /// + /// Test GetPluginsSettings + /// + [Fact] + public void GetPluginsSettingsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.GetPluginsSettings(); + //Assert.IsType(response); + } + + /// + /// Test InstallPlugin + /// + [Fact] + public void InstallPluginTest() + { + // TODO uncomment below to test the method and replace null with proper value + //System.IO.Stream file = null; + //var response = instance.InstallPlugin(file); + //Assert.IsType(response); + } + + /// + /// Test InstallPluginFromRegistry + /// + [Fact] + public void InstallPluginFromRegistryTest() + { + // TODO uncomment below to test the method and replace null with proper value + //BodyUploadUrl bodyUploadUrl = null; + //var response = instance.InstallPluginFromRegistry(bodyUploadUrl); + //Assert.IsType(response); + } + + /// + /// Test ListAvailablePlugins + /// + [Fact] + public void ListAvailablePluginsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string? query = null; + //var response = instance.ListAvailablePlugins(query); + //Assert.IsType(response); + } + + /// + /// Test TogglePlugin + /// + [Fact] + public void TogglePluginTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string pluginId = null; + //var response = instance.TogglePlugin(pluginId); + //Assert.IsType(response); + } + + /// + /// Test UpsertPluginSettings + /// + [Fact] + public void UpsertPluginSettingsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string pluginId = null; + //Object body = null; + //var response = instance.UpsertPluginSettings(pluginId, body); + //Assert.IsType(response); + } + } +} diff --git a/src/CheshireCatApi.Test/Api/RabbitHoleApiTests.cs b/src/CheshireCatApi.Test/Api/RabbitHoleApiTests.cs new file mode 100644 index 0000000..d42160d --- /dev/null +++ b/src/CheshireCatApi.Test/Api/RabbitHoleApiTests.cs @@ -0,0 +1,104 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.Client; +using CheshireCatApi.Api; +// uncomment below to import models +//using CheshireCatApi.Model; + +namespace CheshireCatApi.Test.Api +{ + /// + /// Class for testing RabbitHoleApi + /// + /// + /// 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 RabbitHoleApiTests : IDisposable + { + private RabbitHoleApi instance; + + public RabbitHoleApiTests() + { + instance = new RabbitHoleApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RabbitHoleApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' RabbitHoleApi + //Assert.IsType(instance); + } + + /// + /// Test GetAllowedMimetypes + /// + [Fact] + public void GetAllowedMimetypesTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.GetAllowedMimetypes(); + //Assert.IsType(response); + } + + /// + /// Test UploadFile + /// + [Fact] + public void UploadFileTest() + { + // TODO uncomment below to test the method and replace null with proper value + //System.IO.Stream file = null; + //var response = instance.UploadFile(file); + //Assert.IsType(response); + } + + /// + /// Test UploadMemory + /// + [Fact] + public void UploadMemoryTest() + { + // TODO uncomment below to test the method and replace null with proper value + //System.IO.Stream file = null; + //var response = instance.UploadMemory(file); + //Assert.IsType(response); + } + + /// + /// Test UploadUrl + /// + [Fact] + public void UploadUrlTest() + { + // TODO uncomment below to test the method and replace null with proper value + //BodyUploadUrl bodyUploadUrl = null; + //var response = instance.UploadUrl(bodyUploadUrl); + //Assert.IsType(response); + } + } +} diff --git a/src/CheshireCatApi.Test/Api/SettingsApiTests.cs b/src/CheshireCatApi.Test/Api/SettingsApiTests.cs new file mode 100644 index 0000000..a036756 --- /dev/null +++ b/src/CheshireCatApi.Test/Api/SettingsApiTests.cs @@ -0,0 +1,118 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.Client; +using CheshireCatApi.Api; +// uncomment below to import models +//using CheshireCatApi.Model; + +namespace CheshireCatApi.Test.Api +{ + /// + /// Class for testing SettingsApi + /// + /// + /// 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 SettingsApiTests : IDisposable + { + private SettingsApi instance; + + public SettingsApiTests() + { + instance = new SettingsApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SettingsApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' SettingsApi + //Assert.IsType(instance); + } + + /// + /// Test CreateSetting + /// + [Fact] + public void CreateSettingTest() + { + // TODO uncomment below to test the method and replace null with proper value + //SettingBody settingBody = null; + //var response = instance.CreateSetting(settingBody); + //Assert.IsType(response); + } + + /// + /// Test DeleteSetting + /// + [Fact] + public void DeleteSettingTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string settingId = null; + //var response = instance.DeleteSetting(settingId); + //Assert.IsType(response); + } + + /// + /// Test GetSetting + /// + [Fact] + public void GetSettingTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string settingId = null; + //var response = instance.GetSetting(settingId); + //Assert.IsType(response); + } + + /// + /// Test GetSettings + /// + [Fact] + public void GetSettingsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string? search = null; + //var response = instance.GetSettings(search); + //Assert.IsType(response); + } + + /// + /// Test UpdateSetting + /// + [Fact] + public void UpdateSettingTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string settingId = null; + //SettingBody settingBody = null; + //var response = instance.UpdateSetting(settingId, settingBody); + //Assert.IsType(response); + } + } +} diff --git a/src/CheshireCatApi.Test/Api/StatusApiTests.cs b/src/CheshireCatApi.Test/Api/StatusApiTests.cs new file mode 100644 index 0000000..b3f97cc --- /dev/null +++ b/src/CheshireCatApi.Test/Api/StatusApiTests.cs @@ -0,0 +1,68 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.Client; +using CheshireCatApi.Api; +// uncomment below to import models +//using CheshireCatApi.Model; + +namespace CheshireCatApi.Test.Api +{ + /// + /// Class for testing StatusApi + /// + /// + /// 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 StatusApiTests : IDisposable + { + private StatusApi instance; + + public StatusApiTests() + { + instance = new StatusApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of StatusApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' StatusApi + //Assert.IsType(instance); + } + + /// + /// Test Home + /// + [Fact] + public void HomeTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.Home(); + //Assert.IsType(response); + } + } +} diff --git a/src/CheshireCatApi.Test/CheshireCatApi.Test.csproj b/src/CheshireCatApi.Test/CheshireCatApi.Test.csproj new file mode 100644 index 0000000..2944668 --- /dev/null +++ b/src/CheshireCatApi.Test/CheshireCatApi.Test.csproj @@ -0,0 +1,21 @@ + + + + CheshireCatApi.Test + CheshireCatApi.Test + net8.0 + false + annotations + + + + + + + + + + + + + diff --git a/src/CheshireCatApi.Test/Model/BodyUploadUrlTests.cs b/src/CheshireCatApi.Test/Model/BodyUploadUrlTests.cs new file mode 100644 index 0000000..a5eed58 --- /dev/null +++ b/src/CheshireCatApi.Test/Model/BodyUploadUrlTests.cs @@ -0,0 +1,66 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing BodyUploadUrl + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BodyUploadUrlTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BodyUploadUrl + //private BodyUploadUrl instance; + + public BodyUploadUrlTests() + { + // TODO uncomment below to create an instance of BodyUploadUrl + //instance = new BodyUploadUrl(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BodyUploadUrl + /// + [Fact] + public void BodyUploadUrlInstanceTest() + { + // TODO uncomment below to test "IsType" BodyUploadUrl + //Assert.IsType(instance); + } + + /// + /// Test the property 'Url' + /// + [Fact] + public void UrlTest() + { + // TODO unit test for the property 'Url' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/CollectionDataTests.cs b/src/CheshireCatApi.Test/Model/CollectionDataTests.cs new file mode 100644 index 0000000..82fb408 --- /dev/null +++ b/src/CheshireCatApi.Test/Model/CollectionDataTests.cs @@ -0,0 +1,102 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing CollectionData + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CollectionDataTests : IDisposable + { + // TODO uncomment below to declare an instance variable for CollectionData + //private CollectionData instance; + + public CollectionDataTests() + { + // TODO uncomment below to create an instance of CollectionData + //instance = new CollectionData(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of CollectionData + /// + [Fact] + public void CollectionDataInstanceTest() + { + // TODO uncomment below to test "IsType" CollectionData + //Assert.IsType(instance); + } + + /// + /// Test the property 'PageContent' + /// + [Fact] + public void PageContentTest() + { + // TODO unit test for the property 'PageContent' + } + + /// + /// Test the property 'Metadata' + /// + [Fact] + public void MetadataTest() + { + // TODO unit test for the property 'Metadata' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Score' + /// + [Fact] + public void ScoreTest() + { + // TODO unit test for the property 'Score' + } + + /// + /// Test the property 'Vector' + /// + [Fact] + public void VectorTest() + { + // TODO unit test for the property 'Vector' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/CollectionTests.cs b/src/CheshireCatApi.Test/Model/CollectionTests.cs new file mode 100644 index 0000000..86d6e7a --- /dev/null +++ b/src/CheshireCatApi.Test/Model/CollectionTests.cs @@ -0,0 +1,75 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing Collection + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CollectionTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Collection + //private Collection instance; + + public CollectionTests() + { + // TODO uncomment below to create an instance of Collection + //instance = new Collection(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Collection + /// + [Fact] + public void CollectionInstanceTest() + { + // TODO uncomment below to test "IsType" Collection + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + /// + /// Test the property 'VectorsCount' + /// + [Fact] + public void VectorsCountTest() + { + // TODO unit test for the property 'VectorsCount' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/CollectionsListTests.cs b/src/CheshireCatApi.Test/Model/CollectionsListTests.cs new file mode 100644 index 0000000..00a8eb2 --- /dev/null +++ b/src/CheshireCatApi.Test/Model/CollectionsListTests.cs @@ -0,0 +1,66 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing CollectionsList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CollectionsListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for CollectionsList + //private CollectionsList instance; + + public CollectionsListTests() + { + // TODO uncomment below to create an instance of CollectionsList + //instance = new CollectionsList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of CollectionsList + /// + [Fact] + public void CollectionsListInstanceTest() + { + // TODO uncomment below to test "IsType" CollectionsList + //Assert.IsType(instance); + } + + /// + /// Test the property 'Collections' + /// + [Fact] + public void CollectionsTest() + { + // TODO unit test for the property 'Collections' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/ConversationHistoryTests.cs b/src/CheshireCatApi.Test/Model/ConversationHistoryTests.cs new file mode 100644 index 0000000..04764f9 --- /dev/null +++ b/src/CheshireCatApi.Test/Model/ConversationHistoryTests.cs @@ -0,0 +1,66 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing ConversationHistory + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ConversationHistoryTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ConversationHistory + //private ConversationHistory instance; + + public ConversationHistoryTests() + { + // TODO uncomment below to create an instance of ConversationHistory + //instance = new ConversationHistory(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ConversationHistory + /// + [Fact] + public void ConversationHistoryInstanceTest() + { + // TODO uncomment below to test "IsType" ConversationHistory + //Assert.IsType(instance); + } + + /// + /// Test the property 'History' + /// + [Fact] + public void HistoryTest() + { + // TODO unit test for the property 'History' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/ConversationMessageTests.cs b/src/CheshireCatApi.Test/Model/ConversationMessageTests.cs new file mode 100644 index 0000000..e6d7da3 --- /dev/null +++ b/src/CheshireCatApi.Test/Model/ConversationMessageTests.cs @@ -0,0 +1,84 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing ConversationMessage + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ConversationMessageTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ConversationMessage + //private ConversationMessage instance; + + public ConversationMessageTests() + { + // TODO uncomment below to create an instance of ConversationMessage + //instance = new ConversationMessage(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ConversationMessage + /// + [Fact] + public void ConversationMessageInstanceTest() + { + // TODO uncomment below to test "IsType" ConversationMessage + //Assert.IsType(instance); + } + + /// + /// Test the property 'Who' + /// + [Fact] + public void WhoTest() + { + // TODO unit test for the property 'Who' + } + + /// + /// Test the property 'Message' + /// + [Fact] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + + /// + /// Test the property 'Why' + /// + [Fact] + public void WhyTest() + { + // TODO unit test for the property 'Why' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/DetailTests.cs b/src/CheshireCatApi.Test/Model/DetailTests.cs new file mode 100644 index 0000000..fac20a2 --- /dev/null +++ b/src/CheshireCatApi.Test/Model/DetailTests.cs @@ -0,0 +1,66 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing Detail + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DetailTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Detail + //private Detail instance; + + public DetailTests() + { + // TODO uncomment below to create an instance of Detail + //instance = new Detail(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Detail + /// + [Fact] + public void DetailInstanceTest() + { + // TODO uncomment below to test "IsType" Detail + //Assert.IsType(instance); + } + + /// + /// Test the property 'Error' + /// + [Fact] + public void ErrorTest() + { + // TODO unit test for the property 'Error' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/FileResponseTests.cs b/src/CheshireCatApi.Test/Model/FileResponseTests.cs new file mode 100644 index 0000000..16c35de --- /dev/null +++ b/src/CheshireCatApi.Test/Model/FileResponseTests.cs @@ -0,0 +1,84 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing FileResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FileResponse + //private FileResponse instance; + + public FileResponseTests() + { + // TODO uncomment below to create an instance of FileResponse + //instance = new FileResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FileResponse + /// + [Fact] + public void FileResponseInstanceTest() + { + // TODO uncomment below to test "IsType" FileResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'Filename' + /// + [Fact] + public void FilenameTest() + { + // TODO unit test for the property 'Filename' + } + + /// + /// Test the property 'ContentType' + /// + [Fact] + public void ContentTypeTest() + { + // TODO unit test for the property 'ContentType' + } + + /// + /// Test the property 'Info' + /// + [Fact] + public void InfoTest() + { + // TODO unit test for the property 'Info' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/FiltersTests.cs b/src/CheshireCatApi.Test/Model/FiltersTests.cs new file mode 100644 index 0000000..284dbca --- /dev/null +++ b/src/CheshireCatApi.Test/Model/FiltersTests.cs @@ -0,0 +1,66 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing Filters + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FiltersTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Filters + //private Filters instance; + + public FiltersTests() + { + // TODO uncomment below to create an instance of Filters + //instance = new Filters(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Filters + /// + [Fact] + public void FiltersInstanceTest() + { + // TODO uncomment below to test "IsType" Filters + //Assert.IsType(instance); + } + + /// + /// Test the property 'Query' + /// + [Fact] + public void QueryTest() + { + // TODO unit test for the property 'Query' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/GetPluginSettings200ResponseTests.cs b/src/CheshireCatApi.Test/Model/GetPluginSettings200ResponseTests.cs new file mode 100644 index 0000000..1b7c85c --- /dev/null +++ b/src/CheshireCatApi.Test/Model/GetPluginSettings200ResponseTests.cs @@ -0,0 +1,84 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing GetPluginSettings200Response + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GetPluginSettings200ResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GetPluginSettings200Response + //private GetPluginSettings200Response instance; + + public GetPluginSettings200ResponseTests() + { + // TODO uncomment below to create an instance of GetPluginSettings200Response + //instance = new GetPluginSettings200Response(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GetPluginSettings200Response + /// + [Fact] + public void GetPluginSettings200ResponseInstanceTest() + { + // TODO uncomment below to test "IsType" GetPluginSettings200Response + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + + /// + /// Test the property 'Schema' + /// + [Fact] + public void SchemaTest() + { + // TODO unit test for the property 'Schema' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/HTTPValidationErrorTests.cs b/src/CheshireCatApi.Test/Model/HTTPValidationErrorTests.cs new file mode 100644 index 0000000..385b653 --- /dev/null +++ b/src/CheshireCatApi.Test/Model/HTTPValidationErrorTests.cs @@ -0,0 +1,66 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing HTTPValidationError + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HTTPValidationErrorTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HTTPValidationError + //private HTTPValidationError instance; + + public HTTPValidationErrorTests() + { + // TODO uncomment below to create an instance of HTTPValidationError + //instance = new HTTPValidationError(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HTTPValidationError + /// + [Fact] + public void HTTPValidationErrorInstanceTest() + { + // TODO uncomment below to test "IsType" HTTPValidationError + //Assert.IsType(instance); + } + + /// + /// Test the property 'Detail' + /// + [Fact] + public void DetailTest() + { + // TODO unit test for the property 'Detail' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/HooksInnerTests.cs b/src/CheshireCatApi.Test/Model/HooksInnerTests.cs new file mode 100644 index 0000000..5ac0783 --- /dev/null +++ b/src/CheshireCatApi.Test/Model/HooksInnerTests.cs @@ -0,0 +1,75 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing HooksInner + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HooksInnerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HooksInner + //private HooksInner instance; + + public HooksInnerTests() + { + // TODO uncomment below to create an instance of HooksInner + //instance = new HooksInner(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HooksInner + /// + [Fact] + public void HooksInnerInstanceTest() + { + // TODO uncomment below to test "IsType" HooksInner + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + /// + /// Test the property 'Priority' + /// + [Fact] + public void PriorityTest() + { + // TODO unit test for the property 'Priority' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/MemoryRecallTests.cs b/src/CheshireCatApi.Test/Model/MemoryRecallTests.cs new file mode 100644 index 0000000..e0e39b8 --- /dev/null +++ b/src/CheshireCatApi.Test/Model/MemoryRecallTests.cs @@ -0,0 +1,75 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing MemoryRecall + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MemoryRecallTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MemoryRecall + //private MemoryRecall instance; + + public MemoryRecallTests() + { + // TODO uncomment below to create an instance of MemoryRecall + //instance = new MemoryRecall(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MemoryRecall + /// + [Fact] + public void MemoryRecallInstanceTest() + { + // TODO uncomment below to test "IsType" MemoryRecall + //Assert.IsType(instance); + } + + /// + /// Test the property 'Query' + /// + [Fact] + public void QueryTest() + { + // TODO unit test for the property 'Query' + } + + /// + /// Test the property 'Vectors' + /// + [Fact] + public void VectorsTest() + { + // TODO unit test for the property 'Vectors' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/MetaDataTests.cs b/src/CheshireCatApi.Test/Model/MetaDataTests.cs new file mode 100644 index 0000000..288caeb --- /dev/null +++ b/src/CheshireCatApi.Test/Model/MetaDataTests.cs @@ -0,0 +1,93 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing MetaData + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MetaDataTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MetaData + //private MetaData instance; + + public MetaDataTests() + { + // TODO uncomment below to create an instance of MetaData + //instance = new MetaData(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MetaData + /// + [Fact] + public void MetaDataInstanceTest() + { + // TODO uncomment below to test "IsType" MetaData + //Assert.IsType(instance); + } + + /// + /// Test the property 'Source' + /// + [Fact] + public void SourceTest() + { + // TODO unit test for the property 'Source' + } + + /// + /// Test the property 'When' + /// + [Fact] + public void WhenTest() + { + // TODO unit test for the property 'When' + } + + /// + /// Test the property 'Docstring' + /// + [Fact] + public void DocstringTest() + { + // TODO unit test for the property 'Docstring' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/PluginTests.cs b/src/CheshireCatApi.Test/Model/PluginTests.cs new file mode 100644 index 0000000..f7a0a0f --- /dev/null +++ b/src/CheshireCatApi.Test/Model/PluginTests.cs @@ -0,0 +1,183 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing Plugin + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PluginTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Plugin + //private Plugin instance; + + public PluginTests() + { + // TODO uncomment below to create an instance of Plugin + //instance = new Plugin(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Plugin + /// + [Fact] + public void PluginInstanceTest() + { + // TODO uncomment below to test "IsType" Plugin + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + /// + /// Test the property 'Description' + /// + [Fact] + public void DescriptionTest() + { + // TODO unit test for the property 'Description' + } + + /// + /// Test the property 'AuthorName' + /// + [Fact] + public void AuthorNameTest() + { + // TODO unit test for the property 'AuthorName' + } + + /// + /// Test the property 'AuthorUrl' + /// + [Fact] + public void AuthorUrlTest() + { + // TODO unit test for the property 'AuthorUrl' + } + + /// + /// Test the property 'PluginUrl' + /// + [Fact] + public void PluginUrlTest() + { + // TODO unit test for the property 'PluginUrl' + } + + /// + /// Test the property 'Tags' + /// + [Fact] + public void TagsTest() + { + // TODO unit test for the property 'Tags' + } + + /// + /// Test the property 'Thumb' + /// + [Fact] + public void ThumbTest() + { + // TODO unit test for the property 'Thumb' + } + + /// + /// Test the property 'VarVersion' + /// + [Fact] + public void VarVersionTest() + { + // TODO unit test for the property 'VarVersion' + } + + /// + /// Test the property 'Active' + /// + [Fact] + public void ActiveTest() + { + // TODO unit test for the property 'Active' + } + + /// + /// Test the property 'Url' + /// + [Fact] + public void UrlTest() + { + // TODO unit test for the property 'Url' + } + + /// + /// Test the property 'Upgrade' + /// + [Fact] + public void UpgradeTest() + { + // TODO unit test for the property 'Upgrade' + } + + /// + /// Test the property 'Hooks' + /// + [Fact] + public void HooksTest() + { + // TODO unit test for the property 'Hooks' + } + + /// + /// Test the property 'Tools' + /// + [Fact] + public void ToolsTest() + { + // TODO unit test for the property 'Tools' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/PluginsListTests.cs b/src/CheshireCatApi.Test/Model/PluginsListTests.cs new file mode 100644 index 0000000..83c7079 --- /dev/null +++ b/src/CheshireCatApi.Test/Model/PluginsListTests.cs @@ -0,0 +1,84 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing PluginsList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PluginsListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for PluginsList + //private PluginsList instance; + + public PluginsListTests() + { + // TODO uncomment below to create an instance of PluginsList + //instance = new PluginsList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of PluginsList + /// + [Fact] + public void PluginsListInstanceTest() + { + // TODO uncomment below to test "IsType" PluginsList + //Assert.IsType(instance); + } + + /// + /// Test the property 'Filters' + /// + [Fact] + public void FiltersTest() + { + // TODO unit test for the property 'Filters' + } + + /// + /// Test the property 'Installed' + /// + [Fact] + public void InstalledTest() + { + // TODO unit test for the property 'Installed' + } + + /// + /// Test the property 'Registry' + /// + [Fact] + public void RegistryTest() + { + // TODO unit test for the property 'Registry' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/QueryDataTests.cs b/src/CheshireCatApi.Test/Model/QueryDataTests.cs new file mode 100644 index 0000000..217326e --- /dev/null +++ b/src/CheshireCatApi.Test/Model/QueryDataTests.cs @@ -0,0 +1,75 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing QueryData + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QueryDataTests : IDisposable + { + // TODO uncomment below to declare an instance variable for QueryData + //private QueryData instance; + + public QueryDataTests() + { + // TODO uncomment below to create an instance of QueryData + //instance = new QueryData(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of QueryData + /// + [Fact] + public void QueryDataInstanceTest() + { + // TODO uncomment below to test "IsType" QueryData + //Assert.IsType(instance); + } + + /// + /// Test the property 'Text' + /// + [Fact] + public void TextTest() + { + // TODO unit test for the property 'Text' + } + + /// + /// Test the property 'Vector' + /// + [Fact] + public void VectorTest() + { + // TODO unit test for the property 'Vector' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/ResponseGetAllowedMimetypesTests.cs b/src/CheshireCatApi.Test/Model/ResponseGetAllowedMimetypesTests.cs new file mode 100644 index 0000000..7ae5425 --- /dev/null +++ b/src/CheshireCatApi.Test/Model/ResponseGetAllowedMimetypesTests.cs @@ -0,0 +1,66 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing ResponseGetAllowedMimetypes + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ResponseGetAllowedMimetypesTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ResponseGetAllowedMimetypes + //private ResponseGetAllowedMimetypes instance; + + public ResponseGetAllowedMimetypesTests() + { + // TODO uncomment below to create an instance of ResponseGetAllowedMimetypes + //instance = new ResponseGetAllowedMimetypes(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ResponseGetAllowedMimetypes + /// + [Fact] + public void ResponseGetAllowedMimetypesInstanceTest() + { + // TODO uncomment below to test "IsType" ResponseGetAllowedMimetypes + //Assert.IsType(instance); + } + + /// + /// Test the property 'Allowed' + /// + [Fact] + public void AllowedTest() + { + // TODO unit test for the property 'Allowed' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/SettingBodyTests.cs b/src/CheshireCatApi.Test/Model/SettingBodyTests.cs new file mode 100644 index 0000000..88bdff7 --- /dev/null +++ b/src/CheshireCatApi.Test/Model/SettingBodyTests.cs @@ -0,0 +1,84 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing SettingBody + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SettingBodyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SettingBody + //private SettingBody instance; + + public SettingBodyTests() + { + // TODO uncomment below to create an instance of SettingBody + //instance = new SettingBody(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SettingBody + /// + [Fact] + public void SettingBodyInstanceTest() + { + // TODO uncomment below to test "IsType" SettingBody + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + + /// + /// Test the property 'Category' + /// + [Fact] + public void CategoryTest() + { + // TODO unit test for the property 'Category' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/SettingTests.cs b/src/CheshireCatApi.Test/Model/SettingTests.cs new file mode 100644 index 0000000..b120514 --- /dev/null +++ b/src/CheshireCatApi.Test/Model/SettingTests.cs @@ -0,0 +1,84 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing Setting + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SettingTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Setting + //private Setting instance; + + public SettingTests() + { + // TODO uncomment below to create an instance of Setting + //instance = new Setting(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Setting + /// + [Fact] + public void SettingInstanceTest() + { + // TODO uncomment below to test "IsType" Setting + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + + /// + /// Test the property 'Schema' + /// + [Fact] + public void SchemaTest() + { + // TODO unit test for the property 'Schema' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/SettingsResponseTests.cs b/src/CheshireCatApi.Test/Model/SettingsResponseTests.cs new file mode 100644 index 0000000..de287fe --- /dev/null +++ b/src/CheshireCatApi.Test/Model/SettingsResponseTests.cs @@ -0,0 +1,75 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing SettingsResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SettingsResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SettingsResponse + //private SettingsResponse instance; + + public SettingsResponseTests() + { + // TODO uncomment below to create an instance of SettingsResponse + //instance = new SettingsResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SettingsResponse + /// + [Fact] + public void SettingsResponseInstanceTest() + { + // TODO uncomment below to test "IsType" SettingsResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'Settings' + /// + [Fact] + public void SettingsTest() + { + // TODO unit test for the property 'Settings' + } + + /// + /// Test the property 'SelectedConfiguration' + /// + [Fact] + public void SelectedConfigurationTest() + { + // TODO unit test for the property 'SelectedConfiguration' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/StatusTests.cs b/src/CheshireCatApi.Test/Model/StatusTests.cs new file mode 100644 index 0000000..5e38bdd --- /dev/null +++ b/src/CheshireCatApi.Test/Model/StatusTests.cs @@ -0,0 +1,75 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing Status + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class StatusTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Status + //private Status instance; + + public StatusTests() + { + // TODO uncomment below to create an instance of Status + //instance = new Status(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Status + /// + [Fact] + public void StatusInstanceTest() + { + // TODO uncomment below to test "IsType" Status + //Assert.IsType(instance); + } + + /// + /// Test the property 'VarStatus' + /// + [Fact] + public void VarStatusTest() + { + // TODO unit test for the property 'VarStatus' + } + + /// + /// Test the property 'VarVersion' + /// + [Fact] + public void VarVersionTest() + { + // TODO unit test for the property 'VarVersion' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/ToggleResponseTests.cs b/src/CheshireCatApi.Test/Model/ToggleResponseTests.cs new file mode 100644 index 0000000..5656b2a --- /dev/null +++ b/src/CheshireCatApi.Test/Model/ToggleResponseTests.cs @@ -0,0 +1,66 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing ToggleResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ToggleResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ToggleResponse + //private ToggleResponse instance; + + public ToggleResponseTests() + { + // TODO uncomment below to create an instance of ToggleResponse + //instance = new ToggleResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ToggleResponse + /// + [Fact] + public void ToggleResponseInstanceTest() + { + // TODO uncomment below to test "IsType" ToggleResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'Info' + /// + [Fact] + public void InfoTest() + { + // TODO unit test for the property 'Info' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/ToolsInnerTests.cs b/src/CheshireCatApi.Test/Model/ToolsInnerTests.cs new file mode 100644 index 0000000..fe7c2ae --- /dev/null +++ b/src/CheshireCatApi.Test/Model/ToolsInnerTests.cs @@ -0,0 +1,66 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing ToolsInner + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ToolsInnerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ToolsInner + //private ToolsInner instance; + + public ToolsInnerTests() + { + // TODO uncomment below to create an instance of ToolsInner + //instance = new ToolsInner(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ToolsInner + /// + [Fact] + public void ToolsInnerInstanceTest() + { + // TODO uncomment below to test "IsType" ToolsInner + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/VectorsDataTests.cs b/src/CheshireCatApi.Test/Model/VectorsDataTests.cs new file mode 100644 index 0000000..643b733 --- /dev/null +++ b/src/CheshireCatApi.Test/Model/VectorsDataTests.cs @@ -0,0 +1,75 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing VectorsData + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class VectorsDataTests : IDisposable + { + // TODO uncomment below to declare an instance variable for VectorsData + //private VectorsData instance; + + public VectorsDataTests() + { + // TODO uncomment below to create an instance of VectorsData + //instance = new VectorsData(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of VectorsData + /// + [Fact] + public void VectorsDataInstanceTest() + { + // TODO uncomment below to test "IsType" VectorsData + //Assert.IsType(instance); + } + + /// + /// Test the property 'Embedder' + /// + [Fact] + public void EmbedderTest() + { + // TODO unit test for the property 'Embedder' + } + + /// + /// Test the property 'Collections' + /// + [Fact] + public void CollectionsTest() + { + // TODO unit test for the property 'Collections' + } + } +} diff --git a/src/CheshireCatApi.Test/Model/WebResponseTests.cs b/src/CheshireCatApi.Test/Model/WebResponseTests.cs new file mode 100644 index 0000000..8054dac --- /dev/null +++ b/src/CheshireCatApi.Test/Model/WebResponseTests.cs @@ -0,0 +1,75 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using CheshireCatApi.Model; +using CheshireCatApi.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace CheshireCatApi.Test.Model +{ + /// + /// Class for testing WebResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class WebResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for WebResponse + //private WebResponse instance; + + public WebResponseTests() + { + // TODO uncomment below to create an instance of WebResponse + //instance = new WebResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of WebResponse + /// + [Fact] + public void WebResponseInstanceTest() + { + // TODO uncomment below to test "IsType" WebResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'Url' + /// + [Fact] + public void UrlTest() + { + // TODO unit test for the property 'Url' + } + + /// + /// Test the property 'Info' + /// + [Fact] + public void InfoTest() + { + // TODO unit test for the property 'Info' + } + } +} diff --git a/src/CheshireCatApi/Api/EmbedderApi.cs b/src/CheshireCatApi/Api/EmbedderApi.cs new file mode 100644 index 0000000..5d06525 --- /dev/null +++ b/src/CheshireCatApi/Api/EmbedderApi.cs @@ -0,0 +1,737 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace CheshireCatApi.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IEmbedderApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Get Embedder Settings + /// + /// + /// Get settings and schema of the specified Embedder + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Setting + Setting GetEmbedderSettings(string languageEmbedderName, int operationIndex = 0); + + /// + /// Get Embedder Settings + /// + /// + /// Get settings and schema of the specified Embedder + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Setting + ApiResponse GetEmbedderSettingsWithHttpInfo(string languageEmbedderName, int operationIndex = 0); + /// + /// Get Embedders Settings + /// + /// + /// Get the list of the Embedders + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// SettingsResponse + SettingsResponse GetEmbeddersSettings(int operationIndex = 0); + + /// + /// Get Embedders Settings + /// + /// + /// Get the list of the Embedders + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of SettingsResponse + ApiResponse GetEmbeddersSettingsWithHttpInfo(int operationIndex = 0); + /// + /// Upsert Embedder Setting + /// + /// + /// Upsert the Embedder setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Setting + Setting UpsertEmbedderSetting(string languageEmbedderName, Object body, int operationIndex = 0); + + /// + /// Upsert Embedder Setting + /// + /// + /// Upsert the Embedder setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of Setting + ApiResponse UpsertEmbedderSettingWithHttpInfo(string languageEmbedderName, Object body, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IEmbedderApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Get Embedder Settings + /// + /// + /// Get settings and schema of the specified Embedder + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + System.Threading.Tasks.Task GetEmbedderSettingsAsync(string languageEmbedderName, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Embedder Settings + /// + /// + /// Get settings and schema of the specified Embedder + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + System.Threading.Tasks.Task> GetEmbedderSettingsWithHttpInfoAsync(string languageEmbedderName, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Get Embedders Settings + /// + /// + /// Get the list of the Embedders + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SettingsResponse + System.Threading.Tasks.Task GetEmbeddersSettingsAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Embedders Settings + /// + /// + /// Get the list of the Embedders + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SettingsResponse) + System.Threading.Tasks.Task> GetEmbeddersSettingsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Upsert Embedder Setting + /// + /// + /// Upsert the Embedder setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + System.Threading.Tasks.Task UpsertEmbedderSettingAsync(string languageEmbedderName, Object body, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Upsert Embedder Setting + /// + /// + /// Upsert the Embedder setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + System.Threading.Tasks.Task> UpsertEmbedderSettingWithHttpInfoAsync(string languageEmbedderName, Object body, 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 IEmbedderApi : IEmbedderApiSync, IEmbedderApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class EmbedderApi : IEmbedderApi + { + private CheshireCatApi.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public EmbedderApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public EmbedderApi(string basePath) + { + this.Configuration = CheshireCatApi.Client.Configuration.MergeConfigurations( + CheshireCatApi.Client.GlobalConfiguration.Instance, + new CheshireCatApi.Client.Configuration { BasePath = basePath } + ); + this.Client = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = CheshireCatApi.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public EmbedderApi(CheshireCatApi.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = CheshireCatApi.Client.Configuration.MergeConfigurations( + CheshireCatApi.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = CheshireCatApi.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 EmbedderApi(CheshireCatApi.Client.ISynchronousClient client, CheshireCatApi.Client.IAsynchronousClient asyncClient, CheshireCatApi.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 = CheshireCatApi.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public CheshireCatApi.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public CheshireCatApi.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 CheshireCatApi.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public CheshireCatApi.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; } + } + + /// + /// Get Embedder Settings Get settings and schema of the specified Embedder + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Setting + public Setting GetEmbedderSettings(string languageEmbedderName, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = GetEmbedderSettingsWithHttpInfo(languageEmbedderName); + return localVarResponse.Data; + } + + /// + /// Get Embedder Settings Get settings and schema of the specified Embedder + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Setting + public CheshireCatApi.Client.ApiResponse GetEmbedderSettingsWithHttpInfo(string languageEmbedderName, int operationIndex = 0) + { + // verify the required parameter 'languageEmbedderName' is set + if (languageEmbedderName == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'languageEmbedderName' when calling EmbedderApi->GetEmbedderSettings"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("languageEmbedderName", CheshireCatApi.Client.ClientUtils.ParameterToString(languageEmbedderName)); // path parameter + + localVarRequestOptions.Operation = "EmbedderApi.GetEmbedderSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/embedder/settings/{languageEmbedderName}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetEmbedderSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Embedder Settings Get settings and schema of the specified Embedder + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + public async System.Threading.Tasks.Task GetEmbedderSettingsAsync(string languageEmbedderName, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await GetEmbedderSettingsWithHttpInfoAsync(languageEmbedderName, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Embedder Settings Get settings and schema of the specified Embedder + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + public async System.Threading.Tasks.Task> GetEmbedderSettingsWithHttpInfoAsync(string languageEmbedderName, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'languageEmbedderName' is set + if (languageEmbedderName == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'languageEmbedderName' when calling EmbedderApi->GetEmbedderSettings"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("languageEmbedderName", CheshireCatApi.Client.ClientUtils.ParameterToString(languageEmbedderName)); // path parameter + + localVarRequestOptions.Operation = "EmbedderApi.GetEmbedderSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/embedder/settings/{languageEmbedderName}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetEmbedderSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Embedders Settings Get the list of the Embedders + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// SettingsResponse + public SettingsResponse GetEmbeddersSettings(int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = GetEmbeddersSettingsWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get Embedders Settings Get the list of the Embedders + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of SettingsResponse + public CheshireCatApi.Client.ApiResponse GetEmbeddersSettingsWithHttpInfo(int operationIndex = 0) + { + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "EmbedderApi.GetEmbeddersSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/embedder/settings", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetEmbeddersSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Embedders Settings Get the list of the Embedders + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SettingsResponse + public async System.Threading.Tasks.Task GetEmbeddersSettingsAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await GetEmbeddersSettingsWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Embedders Settings Get the list of the Embedders + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SettingsResponse) + public async System.Threading.Tasks.Task> GetEmbeddersSettingsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "EmbedderApi.GetEmbeddersSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/embedder/settings", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetEmbeddersSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Upsert Embedder Setting Upsert the Embedder setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Setting + public Setting UpsertEmbedderSetting(string languageEmbedderName, Object body, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = UpsertEmbedderSettingWithHttpInfo(languageEmbedderName, body); + return localVarResponse.Data; + } + + /// + /// Upsert Embedder Setting Upsert the Embedder setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of Setting + public CheshireCatApi.Client.ApiResponse UpsertEmbedderSettingWithHttpInfo(string languageEmbedderName, Object body, int operationIndex = 0) + { + // verify the required parameter 'languageEmbedderName' is set + if (languageEmbedderName == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'languageEmbedderName' when calling EmbedderApi->UpsertEmbedderSetting"); + } + + // verify the required parameter 'body' is set + if (body == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'body' when calling EmbedderApi->UpsertEmbedderSetting"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("languageEmbedderName", CheshireCatApi.Client.ClientUtils.ParameterToString(languageEmbedderName)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "EmbedderApi.UpsertEmbedderSetting"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Put("/embedder/settings/{languageEmbedderName}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpsertEmbedderSetting", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Upsert Embedder Setting Upsert the Embedder setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + public async System.Threading.Tasks.Task UpsertEmbedderSettingAsync(string languageEmbedderName, Object body, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await UpsertEmbedderSettingWithHttpInfoAsync(languageEmbedderName, body, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Upsert Embedder Setting Upsert the Embedder setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + public async System.Threading.Tasks.Task> UpsertEmbedderSettingWithHttpInfoAsync(string languageEmbedderName, Object body, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'languageEmbedderName' is set + if (languageEmbedderName == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'languageEmbedderName' when calling EmbedderApi->UpsertEmbedderSetting"); + } + + // verify the required parameter 'body' is set + if (body == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'body' when calling EmbedderApi->UpsertEmbedderSetting"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("languageEmbedderName", CheshireCatApi.Client.ClientUtils.ParameterToString(languageEmbedderName)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "EmbedderApi.UpsertEmbedderSetting"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/embedder/settings/{languageEmbedderName}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpsertEmbedderSetting", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/src/CheshireCatApi/Api/LargeLanguageModelApi.cs b/src/CheshireCatApi/Api/LargeLanguageModelApi.cs new file mode 100644 index 0000000..6a31677 --- /dev/null +++ b/src/CheshireCatApi/Api/LargeLanguageModelApi.cs @@ -0,0 +1,737 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace CheshireCatApi.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ILargeLanguageModelApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Get Llm Settings + /// + /// + /// Get settings and schema of the specified Large Language Model + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Setting + Setting GetLlmSettings(string languageModelName, int operationIndex = 0); + + /// + /// Get Llm Settings + /// + /// + /// Get settings and schema of the specified Large Language Model + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Setting + ApiResponse GetLlmSettingsWithHttpInfo(string languageModelName, int operationIndex = 0); + /// + /// Get LLMs Settings + /// + /// + /// Get the list of the Large Language Models + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// SettingsResponse + SettingsResponse GetLlmsSettings(int operationIndex = 0); + + /// + /// Get LLMs Settings + /// + /// + /// Get the list of the Large Language Models + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of SettingsResponse + ApiResponse GetLlmsSettingsWithHttpInfo(int operationIndex = 0); + /// + /// Upsert LLM Setting + /// + /// + /// Upsert the Large Language Model setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Setting + Setting UpsertLlmSetting(string languageModelName, Object body, int operationIndex = 0); + + /// + /// Upsert LLM Setting + /// + /// + /// Upsert the Large Language Model setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of Setting + ApiResponse UpsertLlmSettingWithHttpInfo(string languageModelName, Object body, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ILargeLanguageModelApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Get Llm Settings + /// + /// + /// Get settings and schema of the specified Large Language Model + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + System.Threading.Tasks.Task GetLlmSettingsAsync(string languageModelName, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Llm Settings + /// + /// + /// Get settings and schema of the specified Large Language Model + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + System.Threading.Tasks.Task> GetLlmSettingsWithHttpInfoAsync(string languageModelName, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Get LLMs Settings + /// + /// + /// Get the list of the Large Language Models + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SettingsResponse + System.Threading.Tasks.Task GetLlmsSettingsAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get LLMs Settings + /// + /// + /// Get the list of the Large Language Models + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SettingsResponse) + System.Threading.Tasks.Task> GetLlmsSettingsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Upsert LLM Setting + /// + /// + /// Upsert the Large Language Model setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + System.Threading.Tasks.Task UpsertLlmSettingAsync(string languageModelName, Object body, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Upsert LLM Setting + /// + /// + /// Upsert the Large Language Model setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + System.Threading.Tasks.Task> UpsertLlmSettingWithHttpInfoAsync(string languageModelName, Object body, 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 ILargeLanguageModelApi : ILargeLanguageModelApiSync, ILargeLanguageModelApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class LargeLanguageModelApi : ILargeLanguageModelApi + { + private CheshireCatApi.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public LargeLanguageModelApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public LargeLanguageModelApi(string basePath) + { + this.Configuration = CheshireCatApi.Client.Configuration.MergeConfigurations( + CheshireCatApi.Client.GlobalConfiguration.Instance, + new CheshireCatApi.Client.Configuration { BasePath = basePath } + ); + this.Client = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = CheshireCatApi.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public LargeLanguageModelApi(CheshireCatApi.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = CheshireCatApi.Client.Configuration.MergeConfigurations( + CheshireCatApi.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = CheshireCatApi.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 LargeLanguageModelApi(CheshireCatApi.Client.ISynchronousClient client, CheshireCatApi.Client.IAsynchronousClient asyncClient, CheshireCatApi.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 = CheshireCatApi.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public CheshireCatApi.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public CheshireCatApi.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 CheshireCatApi.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public CheshireCatApi.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; } + } + + /// + /// Get Llm Settings Get settings and schema of the specified Large Language Model + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Setting + public Setting GetLlmSettings(string languageModelName, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = GetLlmSettingsWithHttpInfo(languageModelName); + return localVarResponse.Data; + } + + /// + /// Get Llm Settings Get settings and schema of the specified Large Language Model + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Setting + public CheshireCatApi.Client.ApiResponse GetLlmSettingsWithHttpInfo(string languageModelName, int operationIndex = 0) + { + // verify the required parameter 'languageModelName' is set + if (languageModelName == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'languageModelName' when calling LargeLanguageModelApi->GetLlmSettings"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("languageModelName", CheshireCatApi.Client.ClientUtils.ParameterToString(languageModelName)); // path parameter + + localVarRequestOptions.Operation = "LargeLanguageModelApi.GetLlmSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/llm/settings/{languageModelName}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetLlmSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Llm Settings Get settings and schema of the specified Large Language Model + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + public async System.Threading.Tasks.Task GetLlmSettingsAsync(string languageModelName, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await GetLlmSettingsWithHttpInfoAsync(languageModelName, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Llm Settings Get settings and schema of the specified Large Language Model + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + public async System.Threading.Tasks.Task> GetLlmSettingsWithHttpInfoAsync(string languageModelName, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'languageModelName' is set + if (languageModelName == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'languageModelName' when calling LargeLanguageModelApi->GetLlmSettings"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("languageModelName", CheshireCatApi.Client.ClientUtils.ParameterToString(languageModelName)); // path parameter + + localVarRequestOptions.Operation = "LargeLanguageModelApi.GetLlmSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/llm/settings/{languageModelName}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetLlmSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get LLMs Settings Get the list of the Large Language Models + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// SettingsResponse + public SettingsResponse GetLlmsSettings(int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = GetLlmsSettingsWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get LLMs Settings Get the list of the Large Language Models + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of SettingsResponse + public CheshireCatApi.Client.ApiResponse GetLlmsSettingsWithHttpInfo(int operationIndex = 0) + { + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "LargeLanguageModelApi.GetLlmsSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/llm/settings", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetLlmsSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get LLMs Settings Get the list of the Large Language Models + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SettingsResponse + public async System.Threading.Tasks.Task GetLlmsSettingsAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await GetLlmsSettingsWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get LLMs Settings Get the list of the Large Language Models + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SettingsResponse) + public async System.Threading.Tasks.Task> GetLlmsSettingsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "LargeLanguageModelApi.GetLlmsSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/llm/settings", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetLlmsSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Upsert LLM Setting Upsert the Large Language Model setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Setting + public Setting UpsertLlmSetting(string languageModelName, Object body, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = UpsertLlmSettingWithHttpInfo(languageModelName, body); + return localVarResponse.Data; + } + + /// + /// Upsert LLM Setting Upsert the Large Language Model setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of Setting + public CheshireCatApi.Client.ApiResponse UpsertLlmSettingWithHttpInfo(string languageModelName, Object body, int operationIndex = 0) + { + // verify the required parameter 'languageModelName' is set + if (languageModelName == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'languageModelName' when calling LargeLanguageModelApi->UpsertLlmSetting"); + } + + // verify the required parameter 'body' is set + if (body == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'body' when calling LargeLanguageModelApi->UpsertLlmSetting"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("languageModelName", CheshireCatApi.Client.ClientUtils.ParameterToString(languageModelName)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "LargeLanguageModelApi.UpsertLlmSetting"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Put("/llm/settings/{languageModelName}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpsertLlmSetting", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Upsert LLM Setting Upsert the Large Language Model setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + public async System.Threading.Tasks.Task UpsertLlmSettingAsync(string languageModelName, Object body, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await UpsertLlmSettingWithHttpInfoAsync(languageModelName, body, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Upsert LLM Setting Upsert the Large Language Model setting + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + public async System.Threading.Tasks.Task> UpsertLlmSettingWithHttpInfoAsync(string languageModelName, Object body, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'languageModelName' is set + if (languageModelName == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'languageModelName' when calling LargeLanguageModelApi->UpsertLlmSetting"); + } + + // verify the required parameter 'body' is set + if (body == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'body' when calling LargeLanguageModelApi->UpsertLlmSetting"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("languageModelName", CheshireCatApi.Client.ClientUtils.ParameterToString(languageModelName)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "LargeLanguageModelApi.UpsertLlmSetting"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/llm/settings/{languageModelName}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpsertLlmSetting", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/src/CheshireCatApi/Api/MemoryApi.cs b/src/CheshireCatApi/Api/MemoryApi.cs new file mode 100644 index 0000000..298770d --- /dev/null +++ b/src/CheshireCatApi/Api/MemoryApi.cs @@ -0,0 +1,1657 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace CheshireCatApi.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IMemoryApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Delete Point In Memory + /// + /// + /// Delete specific point in memory + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// List<string> + List DeletePointInMemory(string collectionId, string memoryId, int operationIndex = 0); + + /// + /// Delete Point In Memory + /// + /// + /// Delete specific point in memory + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of List<string> + ApiResponse> DeletePointInMemoryWithHttpInfo(string collectionId, string memoryId, int operationIndex = 0); + /// + /// Get Collections + /// + /// + /// Get list of available collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// CollectionsList + CollectionsList GetCollections(int operationIndex = 0); + + /// + /// Get Collections + /// + /// + /// Get list of available collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of CollectionsList + ApiResponse GetCollectionsWithHttpInfo(int operationIndex = 0); + /// + /// Get Conversation History + /// + /// + /// Get the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ConversationHistory + ConversationHistory GetConversationHistory(int operationIndex = 0); + + /// + /// Get Conversation History + /// + /// + /// Get the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of ConversationHistory + ApiResponse GetConversationHistoryWithHttpInfo(int operationIndex = 0); + /// + /// Recall Memories From Text + /// + /// + /// Search k memories similar to given text. + /// + /// Thrown when fails to make API call + /// Find memories similar to this text. + /// How many memories to return. (optional, default to 100) + /// Index associated with the operation. + /// MemoryRecall + MemoryRecall RecallMemoriesFromText(string text, int? k = default(int?), int operationIndex = 0); + + /// + /// Recall Memories From Text + /// + /// + /// Search k memories similar to given text. + /// + /// Thrown when fails to make API call + /// Find memories similar to this text. + /// How many memories to return. (optional, default to 100) + /// Index associated with the operation. + /// ApiResponse of MemoryRecall + ApiResponse RecallMemoriesFromTextWithHttpInfo(string text, int? k = default(int?), int operationIndex = 0); + /// + /// Wipe Collections + /// + /// + /// Delete and create all collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<string> + List WipeCollections(int operationIndex = 0); + + /// + /// Wipe Collections + /// + /// + /// Delete and create all collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<string> + ApiResponse> WipeCollectionsWithHttpInfo(int operationIndex = 0); + /// + /// Wipe Conversation History + /// + /// + /// Delete the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<string> + List WipeConversationHistory(int operationIndex = 0); + + /// + /// Wipe Conversation History + /// + /// + /// Delete the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<string> + ApiResponse> WipeConversationHistoryWithHttpInfo(int operationIndex = 0); + /// + /// Wipe Memory Points By Metadata + /// + /// + /// Delete points in memory by filter + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// List<string> + List WipeMemoryPoints(string collectionId, Object? body = default(Object?), int operationIndex = 0); + + /// + /// Wipe Memory Points By Metadata + /// + /// + /// Delete points in memory by filter + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<string> + ApiResponse> WipeMemoryPointsWithHttpInfo(string collectionId, Object? body = default(Object?), int operationIndex = 0); + /// + /// Wipe Single Collection + /// + /// + /// Delete and recreate a collection + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<string> + List WipeSingleCollection(string collectionId, int operationIndex = 0); + + /// + /// Wipe Single Collection + /// + /// + /// Delete and recreate a collection + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<string> + ApiResponse> WipeSingleCollectionWithHttpInfo(string collectionId, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IMemoryApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Delete Point In Memory + /// + /// + /// Delete specific point in memory + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + System.Threading.Tasks.Task> DeletePointInMemoryAsync(string collectionId, string memoryId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Delete Point In Memory + /// + /// + /// Delete specific point in memory + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + System.Threading.Tasks.Task>> DeletePointInMemoryWithHttpInfoAsync(string collectionId, string memoryId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Get Collections + /// + /// + /// Get list of available collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of CollectionsList + System.Threading.Tasks.Task GetCollectionsAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Collections + /// + /// + /// Get list of available collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (CollectionsList) + System.Threading.Tasks.Task> GetCollectionsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Get Conversation History + /// + /// + /// Get the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ConversationHistory + System.Threading.Tasks.Task GetConversationHistoryAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Conversation History + /// + /// + /// Get the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ConversationHistory) + System.Threading.Tasks.Task> GetConversationHistoryWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Recall Memories From Text + /// + /// + /// Search k memories similar to given text. + /// + /// Thrown when fails to make API call + /// Find memories similar to this text. + /// How many memories to return. (optional, default to 100) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of MemoryRecall + System.Threading.Tasks.Task RecallMemoriesFromTextAsync(string text, int? k = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Recall Memories From Text + /// + /// + /// Search k memories similar to given text. + /// + /// Thrown when fails to make API call + /// Find memories similar to this text. + /// How many memories to return. (optional, default to 100) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MemoryRecall) + System.Threading.Tasks.Task> RecallMemoriesFromTextWithHttpInfoAsync(string text, int? k = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Wipe Collections + /// + /// + /// Delete and create all collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + System.Threading.Tasks.Task> WipeCollectionsAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Wipe Collections + /// + /// + /// Delete and create all collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + System.Threading.Tasks.Task>> WipeCollectionsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Wipe Conversation History + /// + /// + /// Delete the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + System.Threading.Tasks.Task> WipeConversationHistoryAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Wipe Conversation History + /// + /// + /// Delete the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + System.Threading.Tasks.Task>> WipeConversationHistoryWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Wipe Memory Points By Metadata + /// + /// + /// Delete points in memory by filter + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + System.Threading.Tasks.Task> WipeMemoryPointsAsync(string collectionId, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Wipe Memory Points By Metadata + /// + /// + /// Delete points in memory by filter + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + System.Threading.Tasks.Task>> WipeMemoryPointsWithHttpInfoAsync(string collectionId, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Wipe Single Collection + /// + /// + /// Delete and recreate a collection + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + System.Threading.Tasks.Task> WipeSingleCollectionAsync(string collectionId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Wipe Single Collection + /// + /// + /// Delete and recreate a collection + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + System.Threading.Tasks.Task>> WipeSingleCollectionWithHttpInfoAsync(string collectionId, 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 IMemoryApi : IMemoryApiSync, IMemoryApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class MemoryApi : IMemoryApi + { + private CheshireCatApi.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public MemoryApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MemoryApi(string basePath) + { + this.Configuration = CheshireCatApi.Client.Configuration.MergeConfigurations( + CheshireCatApi.Client.GlobalConfiguration.Instance, + new CheshireCatApi.Client.Configuration { BasePath = basePath } + ); + this.Client = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = CheshireCatApi.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public MemoryApi(CheshireCatApi.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = CheshireCatApi.Client.Configuration.MergeConfigurations( + CheshireCatApi.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = CheshireCatApi.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 MemoryApi(CheshireCatApi.Client.ISynchronousClient client, CheshireCatApi.Client.IAsynchronousClient asyncClient, CheshireCatApi.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 = CheshireCatApi.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public CheshireCatApi.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public CheshireCatApi.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 CheshireCatApi.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public CheshireCatApi.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; } + } + + /// + /// Delete Point In Memory Delete specific point in memory + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// List<string> + public List DeletePointInMemory(string collectionId, string memoryId, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse> localVarResponse = DeletePointInMemoryWithHttpInfo(collectionId, memoryId); + return localVarResponse.Data; + } + + /// + /// Delete Point In Memory Delete specific point in memory + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of List<string> + public CheshireCatApi.Client.ApiResponse> DeletePointInMemoryWithHttpInfo(string collectionId, string memoryId, int operationIndex = 0) + { + // verify the required parameter 'collectionId' is set + if (collectionId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'collectionId' when calling MemoryApi->DeletePointInMemory"); + } + + // verify the required parameter 'memoryId' is set + if (memoryId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'memoryId' when calling MemoryApi->DeletePointInMemory"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("collection_id", CheshireCatApi.Client.ClientUtils.ParameterToString(collectionId)); // path parameter + localVarRequestOptions.PathParameters.Add("memory_id", CheshireCatApi.Client.ClientUtils.ParameterToString(memoryId)); // path parameter + + localVarRequestOptions.Operation = "MemoryApi.DeletePointInMemory"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Delete>("/memory/collections/{collection_id}/points/{memory_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeletePointInMemory", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete Point In Memory Delete specific point in memory + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + public async System.Threading.Tasks.Task> DeletePointInMemoryAsync(string collectionId, string memoryId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse> localVarResponse = await DeletePointInMemoryWithHttpInfoAsync(collectionId, memoryId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Delete Point In Memory Delete specific point in memory + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + public async System.Threading.Tasks.Task>> DeletePointInMemoryWithHttpInfoAsync(string collectionId, string memoryId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'collectionId' is set + if (collectionId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'collectionId' when calling MemoryApi->DeletePointInMemory"); + } + + // verify the required parameter 'memoryId' is set + if (memoryId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'memoryId' when calling MemoryApi->DeletePointInMemory"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("collection_id", CheshireCatApi.Client.ClientUtils.ParameterToString(collectionId)); // path parameter + localVarRequestOptions.PathParameters.Add("memory_id", CheshireCatApi.Client.ClientUtils.ParameterToString(memoryId)); // path parameter + + localVarRequestOptions.Operation = "MemoryApi.DeletePointInMemory"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync>("/memory/collections/{collection_id}/points/{memory_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeletePointInMemory", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Collections Get list of available collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// CollectionsList + public CollectionsList GetCollections(int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = GetCollectionsWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get Collections Get list of available collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of CollectionsList + public CheshireCatApi.Client.ApiResponse GetCollectionsWithHttpInfo(int operationIndex = 0) + { + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "MemoryApi.GetCollections"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/memory/collections", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetCollections", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Collections Get list of available collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of CollectionsList + public async System.Threading.Tasks.Task GetCollectionsAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await GetCollectionsWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Collections Get list of available collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (CollectionsList) + public async System.Threading.Tasks.Task> GetCollectionsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "MemoryApi.GetCollections"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/memory/collections", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetCollections", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Conversation History Get the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ConversationHistory + public ConversationHistory GetConversationHistory(int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = GetConversationHistoryWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get Conversation History Get the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of ConversationHistory + public CheshireCatApi.Client.ApiResponse GetConversationHistoryWithHttpInfo(int operationIndex = 0) + { + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "MemoryApi.GetConversationHistory"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/memory/conversation_history", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetConversationHistory", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Conversation History Get the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ConversationHistory + public async System.Threading.Tasks.Task GetConversationHistoryAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await GetConversationHistoryWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Conversation History Get the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ConversationHistory) + public async System.Threading.Tasks.Task> GetConversationHistoryWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "MemoryApi.GetConversationHistory"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/memory/conversation_history", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetConversationHistory", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Recall Memories From Text Search k memories similar to given text. + /// + /// Thrown when fails to make API call + /// Find memories similar to this text. + /// How many memories to return. (optional, default to 100) + /// Index associated with the operation. + /// MemoryRecall + public MemoryRecall RecallMemoriesFromText(string text, int? k = default(int?), int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = RecallMemoriesFromTextWithHttpInfo(text, k); + return localVarResponse.Data; + } + + /// + /// Recall Memories From Text Search k memories similar to given text. + /// + /// Thrown when fails to make API call + /// Find memories similar to this text. + /// How many memories to return. (optional, default to 100) + /// Index associated with the operation. + /// ApiResponse of MemoryRecall + public CheshireCatApi.Client.ApiResponse RecallMemoriesFromTextWithHttpInfo(string text, int? k = default(int?), int operationIndex = 0) + { + // verify the required parameter 'text' is set + if (text == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'text' when calling MemoryApi->RecallMemoriesFromText"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(CheshireCatApi.Client.ClientUtils.ParameterToMultiMap("", "text", text)); + if (k != null) + { + localVarRequestOptions.QueryParameters.Add(CheshireCatApi.Client.ClientUtils.ParameterToMultiMap("", "k", k)); + } + + localVarRequestOptions.Operation = "MemoryApi.RecallMemoriesFromText"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/memory/recall", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RecallMemoriesFromText", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Recall Memories From Text Search k memories similar to given text. + /// + /// Thrown when fails to make API call + /// Find memories similar to this text. + /// How many memories to return. (optional, default to 100) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of MemoryRecall + public async System.Threading.Tasks.Task RecallMemoriesFromTextAsync(string text, int? k = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await RecallMemoriesFromTextWithHttpInfoAsync(text, k, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Recall Memories From Text Search k memories similar to given text. + /// + /// Thrown when fails to make API call + /// Find memories similar to this text. + /// How many memories to return. (optional, default to 100) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MemoryRecall) + public async System.Threading.Tasks.Task> RecallMemoriesFromTextWithHttpInfoAsync(string text, int? k = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'text' is set + if (text == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'text' when calling MemoryApi->RecallMemoriesFromText"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(CheshireCatApi.Client.ClientUtils.ParameterToMultiMap("", "text", text)); + if (k != null) + { + localVarRequestOptions.QueryParameters.Add(CheshireCatApi.Client.ClientUtils.ParameterToMultiMap("", "k", k)); + } + + localVarRequestOptions.Operation = "MemoryApi.RecallMemoriesFromText"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/memory/recall", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RecallMemoriesFromText", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Wipe Collections Delete and create all collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<string> + public List WipeCollections(int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse> localVarResponse = WipeCollectionsWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Wipe Collections Delete and create all collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<string> + public CheshireCatApi.Client.ApiResponse> WipeCollectionsWithHttpInfo(int operationIndex = 0) + { + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "MemoryApi.WipeCollections"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Delete>("/memory/collections", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("WipeCollections", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Wipe Collections Delete and create all collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + public async System.Threading.Tasks.Task> WipeCollectionsAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse> localVarResponse = await WipeCollectionsWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Wipe Collections Delete and create all collections + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + public async System.Threading.Tasks.Task>> WipeCollectionsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "MemoryApi.WipeCollections"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync>("/memory/collections", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("WipeCollections", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Wipe Conversation History Delete the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<string> + public List WipeConversationHistory(int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse> localVarResponse = WipeConversationHistoryWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Wipe Conversation History Delete the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<string> + public CheshireCatApi.Client.ApiResponse> WipeConversationHistoryWithHttpInfo(int operationIndex = 0) + { + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "MemoryApi.WipeConversationHistory"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Delete>("/memory/conversation_history", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("WipeConversationHistory", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Wipe Conversation History Delete the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + public async System.Threading.Tasks.Task> WipeConversationHistoryAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse> localVarResponse = await WipeConversationHistoryWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Wipe Conversation History Delete the specified user's conversation history from working memory + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + public async System.Threading.Tasks.Task>> WipeConversationHistoryWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "MemoryApi.WipeConversationHistory"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync>("/memory/conversation_history", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("WipeConversationHistory", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Wipe Memory Points By Metadata Delete points in memory by filter + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// List<string> + public List WipeMemoryPoints(string collectionId, Object? body = default(Object?), int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse> localVarResponse = WipeMemoryPointsWithHttpInfo(collectionId, body); + return localVarResponse.Data; + } + + /// + /// Wipe Memory Points By Metadata Delete points in memory by filter + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of List<string> + public CheshireCatApi.Client.ApiResponse> WipeMemoryPointsWithHttpInfo(string collectionId, Object? body = default(Object?), int operationIndex = 0) + { + // verify the required parameter 'collectionId' is set + if (collectionId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'collectionId' when calling MemoryApi->WipeMemoryPoints"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("collection_id", CheshireCatApi.Client.ClientUtils.ParameterToString(collectionId)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "MemoryApi.WipeMemoryPoints"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Delete>("/memory/collections/{collection_id}/points", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("WipeMemoryPoints", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Wipe Memory Points By Metadata Delete points in memory by filter + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + public async System.Threading.Tasks.Task> WipeMemoryPointsAsync(string collectionId, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse> localVarResponse = await WipeMemoryPointsWithHttpInfoAsync(collectionId, body, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Wipe Memory Points By Metadata Delete points in memory by filter + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + public async System.Threading.Tasks.Task>> WipeMemoryPointsWithHttpInfoAsync(string collectionId, Object? body = default(Object?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'collectionId' is set + if (collectionId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'collectionId' when calling MemoryApi->WipeMemoryPoints"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("collection_id", CheshireCatApi.Client.ClientUtils.ParameterToString(collectionId)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "MemoryApi.WipeMemoryPoints"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync>("/memory/collections/{collection_id}/points", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("WipeMemoryPoints", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Wipe Single Collection Delete and recreate a collection + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<string> + public List WipeSingleCollection(string collectionId, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse> localVarResponse = WipeSingleCollectionWithHttpInfo(collectionId); + return localVarResponse.Data; + } + + /// + /// Wipe Single Collection Delete and recreate a collection + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<string> + public CheshireCatApi.Client.ApiResponse> WipeSingleCollectionWithHttpInfo(string collectionId, int operationIndex = 0) + { + // verify the required parameter 'collectionId' is set + if (collectionId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'collectionId' when calling MemoryApi->WipeSingleCollection"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("collection_id", CheshireCatApi.Client.ClientUtils.ParameterToString(collectionId)); // path parameter + + localVarRequestOptions.Operation = "MemoryApi.WipeSingleCollection"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Delete>("/memory/collections/{collection_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("WipeSingleCollection", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Wipe Single Collection Delete and recreate a collection + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + public async System.Threading.Tasks.Task> WipeSingleCollectionAsync(string collectionId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse> localVarResponse = await WipeSingleCollectionWithHttpInfoAsync(collectionId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Wipe Single Collection Delete and recreate a collection + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + public async System.Threading.Tasks.Task>> WipeSingleCollectionWithHttpInfoAsync(string collectionId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'collectionId' is set + if (collectionId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'collectionId' when calling MemoryApi->WipeSingleCollection"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("collection_id", CheshireCatApi.Client.ClientUtils.ParameterToString(collectionId)); // path parameter + + localVarRequestOptions.Operation = "MemoryApi.WipeSingleCollection"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync>("/memory/collections/{collection_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("WipeSingleCollection", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/src/CheshireCatApi/Api/PluginsApi.cs b/src/CheshireCatApi/Api/PluginsApi.cs new file mode 100644 index 0000000..c581f39 --- /dev/null +++ b/src/CheshireCatApi/Api/PluginsApi.cs @@ -0,0 +1,1887 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace CheshireCatApi.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPluginsApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Delete Plugin + /// + /// + /// Physically remove a plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<string> + List DeletePlugin(string pluginId, int operationIndex = 0); + + /// + /// Delete Plugin + /// + /// + /// Physically remove a plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<string> + ApiResponse> DeletePluginWithHttpInfo(string pluginId, int operationIndex = 0); + /// + /// Get Plugin Details + /// + /// + /// Returns information on a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Plugin + Plugin GetPluginDetails(string pluginId, int operationIndex = 0); + + /// + /// Get Plugin Details + /// + /// + /// Returns information on a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Plugin + ApiResponse GetPluginDetailsWithHttpInfo(string pluginId, int operationIndex = 0); + /// + /// Get Plugin Settings + /// + /// + /// Returns the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// GetPluginSettings200Response + GetPluginSettings200Response GetPluginSettings(string pluginId, int operationIndex = 0); + + /// + /// Get Plugin Settings + /// + /// + /// Returns the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of GetPluginSettings200Response + ApiResponse GetPluginSettingsWithHttpInfo(string pluginId, int operationIndex = 0); + /// + /// Get Plugins Settings + /// + /// + /// Returns the settings of all the plugins + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// SettingsResponse + SettingsResponse GetPluginsSettings(int operationIndex = 0); + + /// + /// Get Plugins Settings + /// + /// + /// Returns the settings of all the plugins + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of SettingsResponse + ApiResponse GetPluginsSettingsWithHttpInfo(int operationIndex = 0); + /// + /// Install Plugin + /// + /// + /// Install a new plugin from a zip file + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FileResponse + FileResponse InstallPlugin(System.IO.Stream file, int operationIndex = 0); + + /// + /// Install Plugin + /// + /// + /// Install a new plugin from a zip file + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FileResponse + ApiResponse InstallPluginWithHttpInfo(System.IO.Stream file, int operationIndex = 0); + /// + /// Install Plugin From Registry + /// + /// + /// Install a new plugin from external repository + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FileResponse + FileResponse InstallPluginFromRegistry(BodyUploadUrl bodyUploadUrl, int operationIndex = 0); + + /// + /// Install Plugin From Registry + /// + /// + /// Install a new plugin from external repository + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FileResponse + ApiResponse InstallPluginFromRegistryWithHttpInfo(BodyUploadUrl bodyUploadUrl, int operationIndex = 0); + /// + /// List Available Plugins + /// + /// + /// List both installed and registry plugins + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// PluginsList + PluginsList ListAvailablePlugins(string? query = default(string?), int operationIndex = 0); + + /// + /// List Available Plugins + /// + /// + /// List both installed and registry plugins + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of PluginsList + ApiResponse ListAvailablePluginsWithHttpInfo(string? query = default(string?), int operationIndex = 0); + /// + /// Toggle Plugin + /// + /// + /// Enable or disable a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ToggleResponse + ToggleResponse TogglePlugin(string pluginId, int operationIndex = 0); + + /// + /// Toggle Plugin + /// + /// + /// Enable or disable a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of ToggleResponse + ApiResponse TogglePluginWithHttpInfo(string pluginId, int operationIndex = 0); + /// + /// Upsert Plugin Settings + /// + /// + /// Updates the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Setting + Setting UpsertPluginSettings(string pluginId, Object body, int operationIndex = 0); + + /// + /// Upsert Plugin Settings + /// + /// + /// Updates the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of Setting + ApiResponse UpsertPluginSettingsWithHttpInfo(string pluginId, Object body, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPluginsApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Delete Plugin + /// + /// + /// Physically remove a plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + System.Threading.Tasks.Task> DeletePluginAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Delete Plugin + /// + /// + /// Physically remove a plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + System.Threading.Tasks.Task>> DeletePluginWithHttpInfoAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Get Plugin Details + /// + /// + /// Returns information on a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Plugin + System.Threading.Tasks.Task GetPluginDetailsAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Plugin Details + /// + /// + /// Returns information on a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Plugin) + System.Threading.Tasks.Task> GetPluginDetailsWithHttpInfoAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Get Plugin Settings + /// + /// + /// Returns the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of GetPluginSettings200Response + System.Threading.Tasks.Task GetPluginSettingsAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Plugin Settings + /// + /// + /// Returns the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GetPluginSettings200Response) + System.Threading.Tasks.Task> GetPluginSettingsWithHttpInfoAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Get Plugins Settings + /// + /// + /// Returns the settings of all the plugins + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SettingsResponse + System.Threading.Tasks.Task GetPluginsSettingsAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Plugins Settings + /// + /// + /// Returns the settings of all the plugins + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SettingsResponse) + System.Threading.Tasks.Task> GetPluginsSettingsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Install Plugin + /// + /// + /// Install a new plugin from a zip file + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FileResponse + System.Threading.Tasks.Task InstallPluginAsync(System.IO.Stream file, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Install Plugin + /// + /// + /// Install a new plugin from a zip file + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FileResponse) + System.Threading.Tasks.Task> InstallPluginWithHttpInfoAsync(System.IO.Stream file, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Install Plugin From Registry + /// + /// + /// Install a new plugin from external repository + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FileResponse + System.Threading.Tasks.Task InstallPluginFromRegistryAsync(BodyUploadUrl bodyUploadUrl, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Install Plugin From Registry + /// + /// + /// Install a new plugin from external repository + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FileResponse) + System.Threading.Tasks.Task> InstallPluginFromRegistryWithHttpInfoAsync(BodyUploadUrl bodyUploadUrl, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// List Available Plugins + /// + /// + /// List both installed and registry plugins + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of PluginsList + System.Threading.Tasks.Task ListAvailablePluginsAsync(string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// List Available Plugins + /// + /// + /// List both installed and registry plugins + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (PluginsList) + System.Threading.Tasks.Task> ListAvailablePluginsWithHttpInfoAsync(string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Toggle Plugin + /// + /// + /// Enable or disable a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ToggleResponse + System.Threading.Tasks.Task TogglePluginAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Toggle Plugin + /// + /// + /// Enable or disable a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ToggleResponse) + System.Threading.Tasks.Task> TogglePluginWithHttpInfoAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Upsert Plugin Settings + /// + /// + /// Updates the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + System.Threading.Tasks.Task UpsertPluginSettingsAsync(string pluginId, Object body, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Upsert Plugin Settings + /// + /// + /// Updates the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + System.Threading.Tasks.Task> UpsertPluginSettingsWithHttpInfoAsync(string pluginId, Object body, 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 IPluginsApi : IPluginsApiSync, IPluginsApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class PluginsApi : IPluginsApi + { + private CheshireCatApi.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public PluginsApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public PluginsApi(string basePath) + { + this.Configuration = CheshireCatApi.Client.Configuration.MergeConfigurations( + CheshireCatApi.Client.GlobalConfiguration.Instance, + new CheshireCatApi.Client.Configuration { BasePath = basePath } + ); + this.Client = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = CheshireCatApi.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public PluginsApi(CheshireCatApi.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = CheshireCatApi.Client.Configuration.MergeConfigurations( + CheshireCatApi.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = CheshireCatApi.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 PluginsApi(CheshireCatApi.Client.ISynchronousClient client, CheshireCatApi.Client.IAsynchronousClient asyncClient, CheshireCatApi.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 = CheshireCatApi.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public CheshireCatApi.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public CheshireCatApi.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 CheshireCatApi.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public CheshireCatApi.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; } + } + + /// + /// Delete Plugin Physically remove a plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// List<string> + public List DeletePlugin(string pluginId, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse> localVarResponse = DeletePluginWithHttpInfo(pluginId); + return localVarResponse.Data; + } + + /// + /// Delete Plugin Physically remove a plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of List<string> + public CheshireCatApi.Client.ApiResponse> DeletePluginWithHttpInfo(string pluginId, int operationIndex = 0) + { + // verify the required parameter 'pluginId' is set + if (pluginId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'pluginId' when calling PluginsApi->DeletePlugin"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("plugin_id", CheshireCatApi.Client.ClientUtils.ParameterToString(pluginId)); // path parameter + + localVarRequestOptions.Operation = "PluginsApi.DeletePlugin"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Delete>("/plugins/{plugin_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeletePlugin", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete Plugin Physically remove a plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + public async System.Threading.Tasks.Task> DeletePluginAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse> localVarResponse = await DeletePluginWithHttpInfoAsync(pluginId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Delete Plugin Physically remove a plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + public async System.Threading.Tasks.Task>> DeletePluginWithHttpInfoAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'pluginId' is set + if (pluginId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'pluginId' when calling PluginsApi->DeletePlugin"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("plugin_id", CheshireCatApi.Client.ClientUtils.ParameterToString(pluginId)); // path parameter + + localVarRequestOptions.Operation = "PluginsApi.DeletePlugin"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync>("/plugins/{plugin_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeletePlugin", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Plugin Details Returns information on a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Plugin + public Plugin GetPluginDetails(string pluginId, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = GetPluginDetailsWithHttpInfo(pluginId); + return localVarResponse.Data; + } + + /// + /// Get Plugin Details Returns information on a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Plugin + public CheshireCatApi.Client.ApiResponse GetPluginDetailsWithHttpInfo(string pluginId, int operationIndex = 0) + { + // verify the required parameter 'pluginId' is set + if (pluginId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'pluginId' when calling PluginsApi->GetPluginDetails"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("plugin_id", CheshireCatApi.Client.ClientUtils.ParameterToString(pluginId)); // path parameter + + localVarRequestOptions.Operation = "PluginsApi.GetPluginDetails"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/plugins/{plugin_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPluginDetails", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Plugin Details Returns information on a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Plugin + public async System.Threading.Tasks.Task GetPluginDetailsAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await GetPluginDetailsWithHttpInfoAsync(pluginId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Plugin Details Returns information on a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Plugin) + public async System.Threading.Tasks.Task> GetPluginDetailsWithHttpInfoAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'pluginId' is set + if (pluginId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'pluginId' when calling PluginsApi->GetPluginDetails"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("plugin_id", CheshireCatApi.Client.ClientUtils.ParameterToString(pluginId)); // path parameter + + localVarRequestOptions.Operation = "PluginsApi.GetPluginDetails"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/plugins/{plugin_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPluginDetails", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Plugin Settings Returns the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// GetPluginSettings200Response + public GetPluginSettings200Response GetPluginSettings(string pluginId, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = GetPluginSettingsWithHttpInfo(pluginId); + return localVarResponse.Data; + } + + /// + /// Get Plugin Settings Returns the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of GetPluginSettings200Response + public CheshireCatApi.Client.ApiResponse GetPluginSettingsWithHttpInfo(string pluginId, int operationIndex = 0) + { + // verify the required parameter 'pluginId' is set + if (pluginId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'pluginId' when calling PluginsApi->GetPluginSettings"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("plugin_id", CheshireCatApi.Client.ClientUtils.ParameterToString(pluginId)); // path parameter + + localVarRequestOptions.Operation = "PluginsApi.GetPluginSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/plugins/settings/{plugin_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPluginSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Plugin Settings Returns the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of GetPluginSettings200Response + public async System.Threading.Tasks.Task GetPluginSettingsAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await GetPluginSettingsWithHttpInfoAsync(pluginId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Plugin Settings Returns the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GetPluginSettings200Response) + public async System.Threading.Tasks.Task> GetPluginSettingsWithHttpInfoAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'pluginId' is set + if (pluginId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'pluginId' when calling PluginsApi->GetPluginSettings"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("plugin_id", CheshireCatApi.Client.ClientUtils.ParameterToString(pluginId)); // path parameter + + localVarRequestOptions.Operation = "PluginsApi.GetPluginSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/plugins/settings/{plugin_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPluginSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Plugins Settings Returns the settings of all the plugins + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// SettingsResponse + public SettingsResponse GetPluginsSettings(int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = GetPluginsSettingsWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get Plugins Settings Returns the settings of all the plugins + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of SettingsResponse + public CheshireCatApi.Client.ApiResponse GetPluginsSettingsWithHttpInfo(int operationIndex = 0) + { + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "PluginsApi.GetPluginsSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/plugins/settings", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPluginsSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Plugins Settings Returns the settings of all the plugins + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SettingsResponse + public async System.Threading.Tasks.Task GetPluginsSettingsAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await GetPluginsSettingsWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Plugins Settings Returns the settings of all the plugins + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SettingsResponse) + public async System.Threading.Tasks.Task> GetPluginsSettingsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "PluginsApi.GetPluginsSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/plugins/settings", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPluginsSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Install Plugin Install a new plugin from a zip file + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FileResponse + public FileResponse InstallPlugin(System.IO.Stream file, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = InstallPluginWithHttpInfo(file); + return localVarResponse.Data; + } + + /// + /// Install Plugin Install a new plugin from a zip file + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FileResponse + public CheshireCatApi.Client.ApiResponse InstallPluginWithHttpInfo(System.IO.Stream file, int operationIndex = 0) + { + // verify the required parameter 'file' is set + if (file == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'file' when calling PluginsApi->InstallPlugin"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.FileParameters.Add("file", file); + + localVarRequestOptions.Operation = "PluginsApi.InstallPlugin"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/plugins/upload", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("InstallPlugin", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Install Plugin Install a new plugin from a zip file + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FileResponse + public async System.Threading.Tasks.Task InstallPluginAsync(System.IO.Stream file, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await InstallPluginWithHttpInfoAsync(file, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Install Plugin Install a new plugin from a zip file + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FileResponse) + public async System.Threading.Tasks.Task> InstallPluginWithHttpInfoAsync(System.IO.Stream file, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'file' is set + if (file == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'file' when calling PluginsApi->InstallPlugin"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.FileParameters.Add("file", file); + + localVarRequestOptions.Operation = "PluginsApi.InstallPlugin"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/plugins/upload", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("InstallPlugin", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Install Plugin From Registry Install a new plugin from external repository + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FileResponse + public FileResponse InstallPluginFromRegistry(BodyUploadUrl bodyUploadUrl, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = InstallPluginFromRegistryWithHttpInfo(bodyUploadUrl); + return localVarResponse.Data; + } + + /// + /// Install Plugin From Registry Install a new plugin from external repository + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FileResponse + public CheshireCatApi.Client.ApiResponse InstallPluginFromRegistryWithHttpInfo(BodyUploadUrl bodyUploadUrl, int operationIndex = 0) + { + // verify the required parameter 'bodyUploadUrl' is set + if (bodyUploadUrl == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'bodyUploadUrl' when calling PluginsApi->InstallPluginFromRegistry"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = bodyUploadUrl; + + localVarRequestOptions.Operation = "PluginsApi.InstallPluginFromRegistry"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/plugins/upload/registry", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("InstallPluginFromRegistry", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Install Plugin From Registry Install a new plugin from external repository + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FileResponse + public async System.Threading.Tasks.Task InstallPluginFromRegistryAsync(BodyUploadUrl bodyUploadUrl, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await InstallPluginFromRegistryWithHttpInfoAsync(bodyUploadUrl, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Install Plugin From Registry Install a new plugin from external repository + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FileResponse) + public async System.Threading.Tasks.Task> InstallPluginFromRegistryWithHttpInfoAsync(BodyUploadUrl bodyUploadUrl, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'bodyUploadUrl' is set + if (bodyUploadUrl == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'bodyUploadUrl' when calling PluginsApi->InstallPluginFromRegistry"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = bodyUploadUrl; + + localVarRequestOptions.Operation = "PluginsApi.InstallPluginFromRegistry"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/plugins/upload/registry", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("InstallPluginFromRegistry", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List Available Plugins List both installed and registry plugins + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// PluginsList + public PluginsList ListAvailablePlugins(string? query = default(string?), int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = ListAvailablePluginsWithHttpInfo(query); + return localVarResponse.Data; + } + + /// + /// List Available Plugins List both installed and registry plugins + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// ApiResponse of PluginsList + public CheshireCatApi.Client.ApiResponse ListAvailablePluginsWithHttpInfo(string? query = default(string?), int operationIndex = 0) + { + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (query != null) + { + localVarRequestOptions.QueryParameters.Add(CheshireCatApi.Client.ClientUtils.ParameterToMultiMap("", "query", query)); + } + + localVarRequestOptions.Operation = "PluginsApi.ListAvailablePlugins"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/plugins", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ListAvailablePlugins", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List Available Plugins List both installed and registry plugins + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of PluginsList + public async System.Threading.Tasks.Task ListAvailablePluginsAsync(string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await ListAvailablePluginsWithHttpInfoAsync(query, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List Available Plugins List both installed and registry plugins + /// + /// Thrown when fails to make API call + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (PluginsList) + public async System.Threading.Tasks.Task> ListAvailablePluginsWithHttpInfoAsync(string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (query != null) + { + localVarRequestOptions.QueryParameters.Add(CheshireCatApi.Client.ClientUtils.ParameterToMultiMap("", "query", query)); + } + + localVarRequestOptions.Operation = "PluginsApi.ListAvailablePlugins"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/plugins", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ListAvailablePlugins", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Toggle Plugin Enable or disable a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ToggleResponse + public ToggleResponse TogglePlugin(string pluginId, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = TogglePluginWithHttpInfo(pluginId); + return localVarResponse.Data; + } + + /// + /// Toggle Plugin Enable or disable a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of ToggleResponse + public CheshireCatApi.Client.ApiResponse TogglePluginWithHttpInfo(string pluginId, int operationIndex = 0) + { + // verify the required parameter 'pluginId' is set + if (pluginId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'pluginId' when calling PluginsApi->TogglePlugin"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("plugin_id", CheshireCatApi.Client.ClientUtils.ParameterToString(pluginId)); // path parameter + + localVarRequestOptions.Operation = "PluginsApi.TogglePlugin"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Put("/plugins/toggle/{plugin_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TogglePlugin", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Toggle Plugin Enable or disable a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ToggleResponse + public async System.Threading.Tasks.Task TogglePluginAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await TogglePluginWithHttpInfoAsync(pluginId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Toggle Plugin Enable or disable a single plugin + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ToggleResponse) + public async System.Threading.Tasks.Task> TogglePluginWithHttpInfoAsync(string pluginId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'pluginId' is set + if (pluginId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'pluginId' when calling PluginsApi->TogglePlugin"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("plugin_id", CheshireCatApi.Client.ClientUtils.ParameterToString(pluginId)); // path parameter + + localVarRequestOptions.Operation = "PluginsApi.TogglePlugin"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/plugins/toggle/{plugin_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TogglePlugin", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Upsert Plugin Settings Updates the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Setting + public Setting UpsertPluginSettings(string pluginId, Object body, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = UpsertPluginSettingsWithHttpInfo(pluginId, body); + return localVarResponse.Data; + } + + /// + /// Upsert Plugin Settings Updates the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of Setting + public CheshireCatApi.Client.ApiResponse UpsertPluginSettingsWithHttpInfo(string pluginId, Object body, int operationIndex = 0) + { + // verify the required parameter 'pluginId' is set + if (pluginId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'pluginId' when calling PluginsApi->UpsertPluginSettings"); + } + + // verify the required parameter 'body' is set + if (body == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'body' when calling PluginsApi->UpsertPluginSettings"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("plugin_id", CheshireCatApi.Client.ClientUtils.ParameterToString(pluginId)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "PluginsApi.UpsertPluginSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Put("/plugins/settings/{plugin_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpsertPluginSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Upsert Plugin Settings Updates the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + public async System.Threading.Tasks.Task UpsertPluginSettingsAsync(string pluginId, Object body, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await UpsertPluginSettingsWithHttpInfoAsync(pluginId, body, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Upsert Plugin Settings Updates the settings of a specific plugin + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + public async System.Threading.Tasks.Task> UpsertPluginSettingsWithHttpInfoAsync(string pluginId, Object body, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'pluginId' is set + if (pluginId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'pluginId' when calling PluginsApi->UpsertPluginSettings"); + } + + // verify the required parameter 'body' is set + if (body == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'body' when calling PluginsApi->UpsertPluginSettings"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("plugin_id", CheshireCatApi.Client.ClientUtils.ParameterToString(pluginId)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "PluginsApi.UpsertPluginSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/plugins/settings/{plugin_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpsertPluginSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/src/CheshireCatApi/Api/RabbitHoleApi.cs b/src/CheshireCatApi/Api/RabbitHoleApi.cs new file mode 100644 index 0000000..8a834e8 --- /dev/null +++ b/src/CheshireCatApi/Api/RabbitHoleApi.cs @@ -0,0 +1,912 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.Client; +using CheshireCatApi.Model; +using WebResponse = CheshireCatApi.Model.WebResponse; + +namespace CheshireCatApi.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IRabbitHoleApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Get Allowed Mimetypes + /// + /// + /// Retrieve the allowed mimetypes that can be ingested by the Rabbit Hole + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ResponseGetAllowedMimetypes + ResponseGetAllowedMimetypes GetAllowedMimetypes(int operationIndex = 0); + + /// + /// Get Allowed Mimetypes + /// + /// + /// Retrieve the allowed mimetypes that can be ingested by the Rabbit Hole + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of ResponseGetAllowedMimetypes + ApiResponse GetAllowedMimetypesWithHttpInfo(int operationIndex = 0); + /// + /// Upload File + /// + /// + /// Upload a file containing text (.txt, .md, .pdf, etc.). File content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FileResponse + FileResponse UploadFile(System.IO.Stream file, int operationIndex = 0); + + /// + /// Upload File + /// + /// + /// Upload a file containing text (.txt, .md, .pdf, etc.). File content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FileResponse + ApiResponse UploadFileWithHttpInfo(System.IO.Stream file, int operationIndex = 0); + /// + /// Upload Memory + /// + /// + /// Upload a memory json file to the cat memory + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Object + Object UploadMemory(System.IO.Stream file, int operationIndex = 0); + + /// + /// Upload Memory + /// + /// + /// Upload a memory json file to the cat memory + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Object + ApiResponse UploadMemoryWithHttpInfo(System.IO.Stream file, int operationIndex = 0); + /// + /// Upload URL + /// + /// + /// Upload a URL. Website content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// WebResponse + WebResponse UploadUrl(BodyUploadUrl bodyUploadUrl, int operationIndex = 0); + + /// + /// Upload URL + /// + /// + /// Upload a URL. Website content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of WebResponse + ApiResponse UploadUrlWithHttpInfo(BodyUploadUrl bodyUploadUrl, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IRabbitHoleApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Get Allowed Mimetypes + /// + /// + /// Retrieve the allowed mimetypes that can be ingested by the Rabbit Hole + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ResponseGetAllowedMimetypes + System.Threading.Tasks.Task GetAllowedMimetypesAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Allowed Mimetypes + /// + /// + /// Retrieve the allowed mimetypes that can be ingested by the Rabbit Hole + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ResponseGetAllowedMimetypes) + System.Threading.Tasks.Task> GetAllowedMimetypesWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Upload File + /// + /// + /// Upload a file containing text (.txt, .md, .pdf, etc.). File content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FileResponse + System.Threading.Tasks.Task UploadFileAsync(System.IO.Stream file, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Upload File + /// + /// + /// Upload a file containing text (.txt, .md, .pdf, etc.). File content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FileResponse) + System.Threading.Tasks.Task> UploadFileWithHttpInfoAsync(System.IO.Stream file, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Upload Memory + /// + /// + /// Upload a memory json file to the cat memory + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UploadMemoryAsync(System.IO.Stream file, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Upload Memory + /// + /// + /// Upload a memory json file to the cat memory + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UploadMemoryWithHttpInfoAsync(System.IO.Stream file, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Upload URL + /// + /// + /// Upload a URL. Website content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of WebResponse + System.Threading.Tasks.Task UploadUrlAsync(BodyUploadUrl bodyUploadUrl, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Upload URL + /// + /// + /// Upload a URL. Website content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WebResponse) + System.Threading.Tasks.Task> UploadUrlWithHttpInfoAsync(BodyUploadUrl bodyUploadUrl, 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 IRabbitHoleApi : IRabbitHoleApiSync, IRabbitHoleApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class RabbitHoleApi : IRabbitHoleApi + { + private CheshireCatApi.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public RabbitHoleApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public RabbitHoleApi(string basePath) + { + this.Configuration = CheshireCatApi.Client.Configuration.MergeConfigurations( + CheshireCatApi.Client.GlobalConfiguration.Instance, + new CheshireCatApi.Client.Configuration { BasePath = basePath } + ); + this.Client = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = CheshireCatApi.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public RabbitHoleApi(CheshireCatApi.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = CheshireCatApi.Client.Configuration.MergeConfigurations( + CheshireCatApi.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = CheshireCatApi.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 RabbitHoleApi(CheshireCatApi.Client.ISynchronousClient client, CheshireCatApi.Client.IAsynchronousClient asyncClient, CheshireCatApi.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 = CheshireCatApi.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public CheshireCatApi.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public CheshireCatApi.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 CheshireCatApi.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public CheshireCatApi.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; } + } + + /// + /// Get Allowed Mimetypes Retrieve the allowed mimetypes that can be ingested by the Rabbit Hole + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ResponseGetAllowedMimetypes + public ResponseGetAllowedMimetypes GetAllowedMimetypes(int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = GetAllowedMimetypesWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get Allowed Mimetypes Retrieve the allowed mimetypes that can be ingested by the Rabbit Hole + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of ResponseGetAllowedMimetypes + public CheshireCatApi.Client.ApiResponse GetAllowedMimetypesWithHttpInfo(int operationIndex = 0) + { + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "RabbitHoleApi.GetAllowedMimetypes"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/rabbithole/allowed-mimetypes", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetAllowedMimetypes", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Allowed Mimetypes Retrieve the allowed mimetypes that can be ingested by the Rabbit Hole + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ResponseGetAllowedMimetypes + public async System.Threading.Tasks.Task GetAllowedMimetypesAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await GetAllowedMimetypesWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Allowed Mimetypes Retrieve the allowed mimetypes that can be ingested by the Rabbit Hole + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ResponseGetAllowedMimetypes) + public async System.Threading.Tasks.Task> GetAllowedMimetypesWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "RabbitHoleApi.GetAllowedMimetypes"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/rabbithole/allowed-mimetypes", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetAllowedMimetypes", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Upload File Upload a file containing text (.txt, .md, .pdf, etc.). File content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FileResponse + public FileResponse UploadFile(System.IO.Stream file, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = UploadFileWithHttpInfo(file); + return localVarResponse.Data; + } + + /// + /// Upload File Upload a file containing text (.txt, .md, .pdf, etc.). File content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FileResponse + public CheshireCatApi.Client.ApiResponse UploadFileWithHttpInfo(System.IO.Stream file, int operationIndex = 0) + { + // verify the required parameter 'file' is set + if (file == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'file' when calling RabbitHoleApi->UploadFile"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.FileParameters.Add("file", file); + + localVarRequestOptions.Operation = "RabbitHoleApi.UploadFile"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/rabbithole", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Upload File Upload a file containing text (.txt, .md, .pdf, etc.). File content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FileResponse + public async System.Threading.Tasks.Task UploadFileAsync(System.IO.Stream file, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await UploadFileWithHttpInfoAsync(file, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Upload File Upload a file containing text (.txt, .md, .pdf, etc.). File content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FileResponse) + public async System.Threading.Tasks.Task> UploadFileWithHttpInfoAsync(System.IO.Stream file, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'file' is set + if (file == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'file' when calling RabbitHoleApi->UploadFile"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.FileParameters.Add("file", file); + + localVarRequestOptions.Operation = "RabbitHoleApi.UploadFile"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/rabbithole", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Upload Memory Upload a memory json file to the cat memory + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Object + public Object UploadMemory(System.IO.Stream file, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = UploadMemoryWithHttpInfo(file); + return localVarResponse.Data; + } + + /// + /// Upload Memory Upload a memory json file to the cat memory + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Object + public CheshireCatApi.Client.ApiResponse UploadMemoryWithHttpInfo(System.IO.Stream file, int operationIndex = 0) + { + // verify the required parameter 'file' is set + if (file == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'file' when calling RabbitHoleApi->UploadMemory"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.FileParameters.Add("file", file); + + localVarRequestOptions.Operation = "RabbitHoleApi.UploadMemory"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/rabbithole/memory", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UploadMemory", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Upload Memory Upload a memory json file to the cat memory + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UploadMemoryAsync(System.IO.Stream file, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await UploadMemoryWithHttpInfoAsync(file, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Upload Memory Upload a memory json file to the cat memory + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UploadMemoryWithHttpInfoAsync(System.IO.Stream file, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'file' is set + if (file == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'file' when calling RabbitHoleApi->UploadMemory"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.FileParameters.Add("file", file); + + localVarRequestOptions.Operation = "RabbitHoleApi.UploadMemory"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/rabbithole/memory", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UploadMemory", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Upload URL Upload a URL. Website content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// WebResponse + public WebResponse UploadUrl(BodyUploadUrl bodyUploadUrl, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = UploadUrlWithHttpInfo(bodyUploadUrl); + return localVarResponse.Data; + } + + /// + /// Upload URL Upload a URL. Website content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of WebResponse + public CheshireCatApi.Client.ApiResponse UploadUrlWithHttpInfo(BodyUploadUrl bodyUploadUrl, int operationIndex = 0) + { + // verify the required parameter 'bodyUploadUrl' is set + if (bodyUploadUrl == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'bodyUploadUrl' when calling RabbitHoleApi->UploadUrl"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = bodyUploadUrl; + + localVarRequestOptions.Operation = "RabbitHoleApi.UploadUrl"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/rabbithole/web", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UploadUrl", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Upload URL Upload a URL. Website content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of WebResponse + public async System.Threading.Tasks.Task UploadUrlAsync(BodyUploadUrl bodyUploadUrl, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await UploadUrlWithHttpInfoAsync(bodyUploadUrl, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Upload URL Upload a URL. Website content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WebResponse) + public async System.Threading.Tasks.Task> UploadUrlWithHttpInfoAsync(BodyUploadUrl bodyUploadUrl, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'bodyUploadUrl' is set + if (bodyUploadUrl == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'bodyUploadUrl' when calling RabbitHoleApi->UploadUrl"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = bodyUploadUrl; + + localVarRequestOptions.Operation = "RabbitHoleApi.UploadUrl"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/rabbithole/web", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UploadUrl", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/src/CheshireCatApi/Api/SettingsApi.cs b/src/CheshireCatApi/Api/SettingsApi.cs new file mode 100644 index 0000000..45b1c77 --- /dev/null +++ b/src/CheshireCatApi/Api/SettingsApi.cs @@ -0,0 +1,1139 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace CheshireCatApi.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ISettingsApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Create Setting + /// + /// + /// Create a new setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Setting + Setting CreateSetting(SettingBody settingBody, int operationIndex = 0); + + /// + /// Create Setting + /// + /// + /// Create a new setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Setting + ApiResponse CreateSettingWithHttpInfo(SettingBody settingBody, int operationIndex = 0); + /// + /// Delete Setting + /// + /// + /// Delete a specific setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Object + Object DeleteSetting(string settingId, int operationIndex = 0); + + /// + /// Delete Setting + /// + /// + /// Delete a specific setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Object + ApiResponse DeleteSettingWithHttpInfo(string settingId, int operationIndex = 0); + /// + /// Get Setting + /// + /// + /// Get the a specific setting from the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Setting + Setting GetSetting(string settingId, int operationIndex = 0); + + /// + /// Get Setting + /// + /// + /// Get the a specific setting from the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Setting + ApiResponse GetSettingWithHttpInfo(string settingId, int operationIndex = 0); + /// + /// Get Settings + /// + /// + /// Get the entire list of settings available in the database + /// + /// Thrown when fails to make API call + /// The setting to search (optional, default to "") + /// Index associated with the operation. + /// SettingsResponse + SettingsResponse GetSettings(string? search = default(string?), int operationIndex = 0); + + /// + /// Get Settings + /// + /// + /// Get the entire list of settings available in the database + /// + /// Thrown when fails to make API call + /// The setting to search (optional, default to "") + /// Index associated with the operation. + /// ApiResponse of SettingsResponse + ApiResponse GetSettingsWithHttpInfo(string? search = default(string?), int operationIndex = 0); + /// + /// Update Setting + /// + /// + /// Update a specific setting in the database if it exists + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Setting + Setting UpdateSetting(string settingId, SettingBody settingBody, int operationIndex = 0); + + /// + /// Update Setting + /// + /// + /// Update a specific setting in the database if it exists + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of Setting + ApiResponse UpdateSettingWithHttpInfo(string settingId, SettingBody settingBody, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ISettingsApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Create Setting + /// + /// + /// Create a new setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + System.Threading.Tasks.Task CreateSettingAsync(SettingBody settingBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Create Setting + /// + /// + /// Create a new setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + System.Threading.Tasks.Task> CreateSettingWithHttpInfoAsync(SettingBody settingBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Delete Setting + /// + /// + /// Delete a specific setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task DeleteSettingAsync(string settingId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Delete Setting + /// + /// + /// Delete a specific setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> DeleteSettingWithHttpInfoAsync(string settingId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Get Setting + /// + /// + /// Get the a specific setting from the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + System.Threading.Tasks.Task GetSettingAsync(string settingId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Setting + /// + /// + /// Get the a specific setting from the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + System.Threading.Tasks.Task> GetSettingWithHttpInfoAsync(string settingId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Get Settings + /// + /// + /// Get the entire list of settings available in the database + /// + /// Thrown when fails to make API call + /// The setting to search (optional, default to "") + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SettingsResponse + System.Threading.Tasks.Task GetSettingsAsync(string? search = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Settings + /// + /// + /// Get the entire list of settings available in the database + /// + /// Thrown when fails to make API call + /// The setting to search (optional, default to "") + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SettingsResponse) + System.Threading.Tasks.Task> GetSettingsWithHttpInfoAsync(string? search = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Update Setting + /// + /// + /// Update a specific setting in the database if it exists + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + System.Threading.Tasks.Task UpdateSettingAsync(string settingId, SettingBody settingBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update Setting + /// + /// + /// Update a specific setting in the database if it exists + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + System.Threading.Tasks.Task> UpdateSettingWithHttpInfoAsync(string settingId, SettingBody settingBody, 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 ISettingsApi : ISettingsApiSync, ISettingsApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class SettingsApi : ISettingsApi + { + private CheshireCatApi.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public SettingsApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public SettingsApi(string basePath) + { + this.Configuration = CheshireCatApi.Client.Configuration.MergeConfigurations( + CheshireCatApi.Client.GlobalConfiguration.Instance, + new CheshireCatApi.Client.Configuration { BasePath = basePath } + ); + this.Client = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = CheshireCatApi.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public SettingsApi(CheshireCatApi.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = CheshireCatApi.Client.Configuration.MergeConfigurations( + CheshireCatApi.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = CheshireCatApi.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 SettingsApi(CheshireCatApi.Client.ISynchronousClient client, CheshireCatApi.Client.IAsynchronousClient asyncClient, CheshireCatApi.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 = CheshireCatApi.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public CheshireCatApi.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public CheshireCatApi.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 CheshireCatApi.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public CheshireCatApi.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; } + } + + /// + /// Create Setting Create a new setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Setting + public Setting CreateSetting(SettingBody settingBody, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = CreateSettingWithHttpInfo(settingBody); + return localVarResponse.Data; + } + + /// + /// Create Setting Create a new setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Setting + public CheshireCatApi.Client.ApiResponse CreateSettingWithHttpInfo(SettingBody settingBody, int operationIndex = 0) + { + // verify the required parameter 'settingBody' is set + if (settingBody == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'settingBody' when calling SettingsApi->CreateSetting"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = settingBody; + + localVarRequestOptions.Operation = "SettingsApi.CreateSetting"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/settings", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateSetting", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create Setting Create a new setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + public async System.Threading.Tasks.Task CreateSettingAsync(SettingBody settingBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await CreateSettingWithHttpInfoAsync(settingBody, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Create Setting Create a new setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + public async System.Threading.Tasks.Task> CreateSettingWithHttpInfoAsync(SettingBody settingBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'settingBody' is set + if (settingBody == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'settingBody' when calling SettingsApi->CreateSetting"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = settingBody; + + localVarRequestOptions.Operation = "SettingsApi.CreateSetting"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/settings", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateSetting", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete Setting Delete a specific setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Object + public Object DeleteSetting(string settingId, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = DeleteSettingWithHttpInfo(settingId); + return localVarResponse.Data; + } + + /// + /// Delete Setting Delete a specific setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Object + public CheshireCatApi.Client.ApiResponse DeleteSettingWithHttpInfo(string settingId, int operationIndex = 0) + { + // verify the required parameter 'settingId' is set + if (settingId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'settingId' when calling SettingsApi->DeleteSetting"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("settingId", CheshireCatApi.Client.ClientUtils.ParameterToString(settingId)); // path parameter + + localVarRequestOptions.Operation = "SettingsApi.DeleteSetting"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Delete("/settings/{settingId}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteSetting", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete Setting Delete a specific setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task DeleteSettingAsync(string settingId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await DeleteSettingWithHttpInfoAsync(settingId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Delete Setting Delete a specific setting in the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> DeleteSettingWithHttpInfoAsync(string settingId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'settingId' is set + if (settingId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'settingId' when calling SettingsApi->DeleteSetting"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("settingId", CheshireCatApi.Client.ClientUtils.ParameterToString(settingId)); // path parameter + + localVarRequestOptions.Operation = "SettingsApi.DeleteSetting"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/settings/{settingId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteSetting", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Setting Get the a specific setting from the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Setting + public Setting GetSetting(string settingId, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = GetSettingWithHttpInfo(settingId); + return localVarResponse.Data; + } + + /// + /// Get Setting Get the a specific setting from the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Setting + public CheshireCatApi.Client.ApiResponse GetSettingWithHttpInfo(string settingId, int operationIndex = 0) + { + // verify the required parameter 'settingId' is set + if (settingId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'settingId' when calling SettingsApi->GetSetting"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("settingId", CheshireCatApi.Client.ClientUtils.ParameterToString(settingId)); // path parameter + + localVarRequestOptions.Operation = "SettingsApi.GetSetting"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/settings/{settingId}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetSetting", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Setting Get the a specific setting from the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + public async System.Threading.Tasks.Task GetSettingAsync(string settingId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await GetSettingWithHttpInfoAsync(settingId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Setting Get the a specific setting from the database + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + public async System.Threading.Tasks.Task> GetSettingWithHttpInfoAsync(string settingId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'settingId' is set + if (settingId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'settingId' when calling SettingsApi->GetSetting"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("settingId", CheshireCatApi.Client.ClientUtils.ParameterToString(settingId)); // path parameter + + localVarRequestOptions.Operation = "SettingsApi.GetSetting"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/settings/{settingId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetSetting", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Settings Get the entire list of settings available in the database + /// + /// Thrown when fails to make API call + /// The setting to search (optional, default to "") + /// Index associated with the operation. + /// SettingsResponse + public SettingsResponse GetSettings(string? search = default(string?), int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = GetSettingsWithHttpInfo(search); + return localVarResponse.Data; + } + + /// + /// Get Settings Get the entire list of settings available in the database + /// + /// Thrown when fails to make API call + /// The setting to search (optional, default to "") + /// Index associated with the operation. + /// ApiResponse of SettingsResponse + public CheshireCatApi.Client.ApiResponse GetSettingsWithHttpInfo(string? search = default(string?), int operationIndex = 0) + { + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (search != null) + { + localVarRequestOptions.QueryParameters.Add(CheshireCatApi.Client.ClientUtils.ParameterToMultiMap("", "search", search)); + } + + localVarRequestOptions.Operation = "SettingsApi.GetSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/settings", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Settings Get the entire list of settings available in the database + /// + /// Thrown when fails to make API call + /// The setting to search (optional, default to "") + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SettingsResponse + public async System.Threading.Tasks.Task GetSettingsAsync(string? search = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await GetSettingsWithHttpInfoAsync(search, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Settings Get the entire list of settings available in the database + /// + /// Thrown when fails to make API call + /// The setting to search (optional, default to "") + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SettingsResponse) + public async System.Threading.Tasks.Task> GetSettingsWithHttpInfoAsync(string? search = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (search != null) + { + localVarRequestOptions.QueryParameters.Add(CheshireCatApi.Client.ClientUtils.ParameterToMultiMap("", "search", search)); + } + + localVarRequestOptions.Operation = "SettingsApi.GetSettings"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/settings", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetSettings", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update Setting Update a specific setting in the database if it exists + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Setting + public Setting UpdateSetting(string settingId, SettingBody settingBody, int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = UpdateSettingWithHttpInfo(settingId, settingBody); + return localVarResponse.Data; + } + + /// + /// Update Setting Update a specific setting in the database if it exists + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of Setting + public CheshireCatApi.Client.ApiResponse UpdateSettingWithHttpInfo(string settingId, SettingBody settingBody, int operationIndex = 0) + { + // verify the required parameter 'settingId' is set + if (settingId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'settingId' when calling SettingsApi->UpdateSetting"); + } + + // verify the required parameter 'settingBody' is set + if (settingBody == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'settingBody' when calling SettingsApi->UpdateSetting"); + } + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("settingId", CheshireCatApi.Client.ClientUtils.ParameterToString(settingId)); // path parameter + localVarRequestOptions.Data = settingBody; + + localVarRequestOptions.Operation = "SettingsApi.UpdateSetting"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Put("/settings/{settingId}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateSetting", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update Setting Update a specific setting in the database if it exists + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Setting + public async System.Threading.Tasks.Task UpdateSettingAsync(string settingId, SettingBody settingBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await UpdateSettingWithHttpInfoAsync(settingId, settingBody, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Update Setting Update a specific setting in the database if it exists + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Setting) + public async System.Threading.Tasks.Task> UpdateSettingWithHttpInfoAsync(string settingId, SettingBody settingBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'settingId' is set + if (settingId == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'settingId' when calling SettingsApi->UpdateSetting"); + } + + // verify the required parameter 'settingBody' is set + if (settingBody == null) + { + throw new CheshireCatApi.Client.ApiException(400, "Missing required parameter 'settingBody' when calling SettingsApi->UpdateSetting"); + } + + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("settingId", CheshireCatApi.Client.ClientUtils.ParameterToString(settingId)); // path parameter + localVarRequestOptions.Data = settingBody; + + localVarRequestOptions.Operation = "SettingsApi.UpdateSetting"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/settings/{settingId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateSetting", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/src/CheshireCatApi/Api/StatusApi.cs b/src/CheshireCatApi/Api/StatusApi.cs new file mode 100644 index 0000000..ed50f4a --- /dev/null +++ b/src/CheshireCatApi/Api/StatusApi.cs @@ -0,0 +1,329 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.Client; +using CheshireCatApi.Model; + +namespace CheshireCatApi.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStatusApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Home + /// + /// + /// Server status + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Status + Status Home(int operationIndex = 0); + + /// + /// Home + /// + /// + /// Server status + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of Status + ApiResponse HomeWithHttpInfo(int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStatusApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Home + /// + /// + /// Server status + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Status + System.Threading.Tasks.Task HomeAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Home + /// + /// + /// Server status + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Status) + System.Threading.Tasks.Task> HomeWithHttpInfoAsync(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 IStatusApi : IStatusApiSync, IStatusApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class StatusApi : IStatusApi + { + private CheshireCatApi.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public StatusApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public StatusApi(string basePath) + { + this.Configuration = CheshireCatApi.Client.Configuration.MergeConfigurations( + CheshireCatApi.Client.GlobalConfiguration.Instance, + new CheshireCatApi.Client.Configuration { BasePath = basePath } + ); + this.Client = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = CheshireCatApi.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public StatusApi(CheshireCatApi.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = CheshireCatApi.Client.Configuration.MergeConfigurations( + CheshireCatApi.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new CheshireCatApi.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = CheshireCatApi.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 StatusApi(CheshireCatApi.Client.ISynchronousClient client, CheshireCatApi.Client.IAsynchronousClient asyncClient, CheshireCatApi.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 = CheshireCatApi.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public CheshireCatApi.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public CheshireCatApi.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 CheshireCatApi.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public CheshireCatApi.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; } + } + + /// + /// Home Server status + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Status + public Status Home(int operationIndex = 0) + { + CheshireCatApi.Client.ApiResponse localVarResponse = HomeWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Home Server status + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of Status + public CheshireCatApi.Client.ApiResponse HomeWithHttpInfo(int operationIndex = 0) + { + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "StatusApi.Home"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Home", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Home Server status + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Status + public async System.Threading.Tasks.Task HomeAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CheshireCatApi.Client.ApiResponse localVarResponse = await HomeWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Home Server status + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Status) + public async System.Threading.Tasks.Task> HomeWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + CheshireCatApi.Client.RequestOptions localVarRequestOptions = new CheshireCatApi.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = CheshireCatApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = CheshireCatApi.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "StatusApi.Home"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Home", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/src/CheshireCatApi/CatClient.cs b/src/CheshireCatApi/CatClient.cs new file mode 100644 index 0000000..01e939a --- /dev/null +++ b/src/CheshireCatApi/CatClient.cs @@ -0,0 +1,66 @@ +using System; +using WebSocketSharp; +using Newtonsoft.Json; + +namespace CheshireCatApi; + +public class CatClient +{ + private WebSocket _webSocket; + + public Configuration websocketConfig; + public Action OnMessage { get; set; } + public Action OnOpen { get; set; } + public Action OnClose { get; set; } + public Action OnError { get; set; } + + public CatClient() + : this(new Configuration()) + { + } + + public CatClient(Configuration connConfiguration) + { + websocketConfig = connConfiguration; + string protocol = websocketConfig.secureConnection ? "wss" : "ws"; + Console.WriteLine(protocol); + _webSocket = new WebSocket($"ws://{websocketConfig.baseUrl}:{websocketConfig.port}/ws/{websocketConfig.userId}"); + + _webSocket.OnMessage += (sender, e) => + { + OnMessage?.Invoke(e.Data); + }; + + _webSocket.OnOpen += (sender, e) => + { + OnOpen?.Invoke(); + }; + + _webSocket.OnClose += (sender, e) => + { + OnClose?.Invoke(); + }; + + _webSocket.OnError += (sender, e) => + { + OnError?.Invoke(); + }; + } + + public void ConnectWebsocket() + { + _webSocket.Connect(); + } + + public void Disconnect() + { + _webSocket.Close(); + } + + public void SendMessage(string text) + { + Message message = new Message { text = text }; + string jsonMessage = JsonConvert.SerializeObject(message); + _webSocket.Send(jsonMessage); + } +} \ No newline at end of file diff --git a/src/CheshireCatApi/CheshireCatApi.csproj b/src/CheshireCatApi/CheshireCatApi.csproj new file mode 100644 index 0000000..97f8af8 --- /dev/null +++ b/src/CheshireCatApi/CheshireCatApi.csproj @@ -0,0 +1,37 @@ + + + + false + net8.0 + CheshireCatApi + CheshireCatApi + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + CheshireCatApi + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\CheshireCatApi.xml + https://github.com/cheshire-cat-ai/api-client-csharp.git + git + Minor update + annotations + + + + + + + + + + + + + + + + + diff --git a/src/CheshireCatApi/Client/ApiClient.cs b/src/CheshireCatApi/Client/ApiClient.cs new file mode 100644 index 0000000..7616b69 --- /dev/null +++ b/src/CheshireCatApi/Client/ApiClient.cs @@ -0,0 +1,833 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.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 CheshireCatApi.Model.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((CheshireCatApi.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 = CheshireCatApi.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(CheshireCatApi.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(CheshireCatApi.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/src/CheshireCatApi/Client/ApiException.cs b/src/CheshireCatApi/Client/ApiException.cs new file mode 100644 index 0000000..8d14731 --- /dev/null +++ b/src/CheshireCatApi/Client/ApiException.cs @@ -0,0 +1,68 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace CheshireCatApi.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/src/CheshireCatApi/Client/ApiResponse.cs b/src/CheshireCatApi/Client/ApiResponse.cs new file mode 100644 index 0000000..a0bb658 --- /dev/null +++ b/src/CheshireCatApi/Client/ApiResponse.cs @@ -0,0 +1,166 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; + +namespace CheshireCatApi.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/src/CheshireCatApi/Client/ClientUtils.cs b/src/CheshireCatApi/Client/ClientUtils.cs new file mode 100644 index 0000000..f3721c0 --- /dev/null +++ b/src/CheshireCatApi/Client/ClientUtils.cs @@ -0,0 +1,247 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.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/src/CheshireCatApi/Client/Configuration.cs b/src/CheshireCatApi/Client/Configuration.cs new file mode 100644 index 0000000..e1c803f --- /dev/null +++ b/src/CheshireCatApi/Client/Configuration.cs @@ -0,0 +1,612 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.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 = "http://localhost"; + DefaultHeaders = new ConcurrentDictionary(); + ApiKey = new ConcurrentDictionary(); + ApiKeyPrefix = new ConcurrentDictionary(); + Servers = new List>() + { + { + new Dictionary { + {"url", ""}, + {"description", "No description provided"}, + } + } + }; + 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 = "http://localhost") : 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 (CheshireCatApi) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: 0.0.5\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/src/CheshireCatApi/Client/ExceptionFactory.cs b/src/CheshireCatApi/Client/ExceptionFactory.cs new file mode 100644 index 0000000..373855a --- /dev/null +++ b/src/CheshireCatApi/Client/ExceptionFactory.cs @@ -0,0 +1,22 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace CheshireCatApi.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + public delegate Exception ExceptionFactory(string methodName, IApiResponse response); +} diff --git a/src/CheshireCatApi/Client/GlobalConfiguration.cs b/src/CheshireCatApi/Client/GlobalConfiguration.cs new file mode 100644 index 0000000..8c94ec7 --- /dev/null +++ b/src/CheshireCatApi/Client/GlobalConfiguration.cs @@ -0,0 +1,67 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System.Collections.Generic; + +namespace CheshireCatApi.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/src/CheshireCatApi/Client/HttpMethod.cs b/src/CheshireCatApi/Client/HttpMethod.cs new file mode 100644 index 0000000..5a554fb --- /dev/null +++ b/src/CheshireCatApi/Client/HttpMethod.cs @@ -0,0 +1,33 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace CheshireCatApi.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/src/CheshireCatApi/Client/IApiAccessor.cs b/src/CheshireCatApi/Client/IApiAccessor.cs new file mode 100644 index 0000000..7bf01a3 --- /dev/null +++ b/src/CheshireCatApi/Client/IApiAccessor.cs @@ -0,0 +1,37 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace CheshireCatApi.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/src/CheshireCatApi/Client/IAsynchronousClient.cs b/src/CheshireCatApi/Client/IAsynchronousClient.cs new file mode 100644 index 0000000..c861c5c --- /dev/null +++ b/src/CheshireCatApi/Client/IAsynchronousClient.cs @@ -0,0 +1,100 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Threading.Tasks; + +namespace CheshireCatApi.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/src/CheshireCatApi/Client/IReadableConfiguration.cs b/src/CheshireCatApi/Client/IReadableConfiguration.cs new file mode 100644 index 0000000..cbd8dff --- /dev/null +++ b/src/CheshireCatApi/Client/IReadableConfiguration.cs @@ -0,0 +1,141 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 CheshireCatApi.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/src/CheshireCatApi/Client/ISynchronousClient.cs b/src/CheshireCatApi/Client/ISynchronousClient.cs new file mode 100644 index 0000000..a5d1b75 --- /dev/null +++ b/src/CheshireCatApi/Client/ISynchronousClient.cs @@ -0,0 +1,93 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.IO; + +namespace CheshireCatApi.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/src/CheshireCatApi/Client/Multimap.cs b/src/CheshireCatApi/Client/Multimap.cs new file mode 100644 index 0000000..703f5b2 --- /dev/null +++ b/src/CheshireCatApi/Client/Multimap.cs @@ -0,0 +1,295 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace CheshireCatApi.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/src/CheshireCatApi/Client/OpenAPIDateConverter.cs b/src/CheshireCatApi/Client/OpenAPIDateConverter.cs new file mode 100644 index 0000000..8ef03a6 --- /dev/null +++ b/src/CheshireCatApi/Client/OpenAPIDateConverter.cs @@ -0,0 +1,29 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using Newtonsoft.Json.Converters; + +namespace CheshireCatApi.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/src/CheshireCatApi/Client/RequestOptions.cs b/src/CheshireCatApi/Client/RequestOptions.cs new file mode 100644 index 0000000..1c57e79 --- /dev/null +++ b/src/CheshireCatApi/Client/RequestOptions.cs @@ -0,0 +1,84 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace CheshireCatApi.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/src/CheshireCatApi/Client/RetryConfiguration.cs b/src/CheshireCatApi/Client/RetryConfiguration.cs new file mode 100644 index 0000000..75d7139 --- /dev/null +++ b/src/CheshireCatApi/Client/RetryConfiguration.cs @@ -0,0 +1,31 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Polly; +using RestSharp; + +namespace CheshireCatApi.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/src/CheshireCatApi/Configuration.cs b/src/CheshireCatApi/Configuration.cs new file mode 100644 index 0000000..8bc6075 --- /dev/null +++ b/src/CheshireCatApi/Configuration.cs @@ -0,0 +1,19 @@ +namespace CheshireCatApi; + +public struct Configuration +{ + public string baseUrl; + public int port; + public string userId; + public string auth_key; + public bool secureConnection; + + public Configuration() + { + baseUrl = "localhost"; + port = 1865; + userId = "user"; + auth_key = ""; + secureConnection = false; + } +} \ No newline at end of file diff --git a/src/CheshireCatApi/Message.cs b/src/CheshireCatApi/Message.cs new file mode 100644 index 0000000..a15a840 --- /dev/null +++ b/src/CheshireCatApi/Message.cs @@ -0,0 +1,6 @@ +namespace CheshireCatApi; + +public class Message +{ + public string text; +} \ No newline at end of file diff --git a/src/CheshireCatApi/Model/AbstractOpenAPISchema.cs b/src/CheshireCatApi/Model/AbstractOpenAPISchema.cs new file mode 100644 index 0000000..610cf38 --- /dev/null +++ b/src/CheshireCatApi/Model/AbstractOpenAPISchema.cs @@ -0,0 +1,76 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace CheshireCatApi.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/src/CheshireCatApi/Model/BodyUploadUrl.cs b/src/CheshireCatApi/Model/BodyUploadUrl.cs new file mode 100644 index 0000000..55d229a --- /dev/null +++ b/src/CheshireCatApi/Model/BodyUploadUrl.cs @@ -0,0 +1,93 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// BodyUploadUrl + /// + [DataContract(Name = "BodyUploadUrl")] + public partial class BodyUploadUrl : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BodyUploadUrl() { } + /// + /// Initializes a new instance of the class. + /// + /// URL of the website to which you want to save the content (required). + public BodyUploadUrl(string url = default(string)) + { + // to ensure "url" is required (not null) + if (url == null) + { + throw new ArgumentNullException("url is a required property for BodyUploadUrl and cannot be null"); + } + this.Url = url; + } + + /// + /// URL of the website to which you want to save the content + /// + /// URL of the website to which you want to save the content + [DataMember(Name = "url", IsRequired = true, EmitDefaultValue = true)] + public string Url { 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 BodyUploadUrl {\n"); + sb.Append(" Url: ").Append(Url).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/src/CheshireCatApi/Model/Collection.cs b/src/CheshireCatApi/Model/Collection.cs new file mode 100644 index 0000000..e1016ae --- /dev/null +++ b/src/CheshireCatApi/Model/Collection.cs @@ -0,0 +1,101 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// Collection + /// + [DataContract(Name = "Collection")] + public partial class Collection : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Collection() { } + /// + /// Initializes a new instance of the class. + /// + /// name (required). + /// vectorsCount (required). + public Collection(string name = default(string), int vectorsCount = default(int)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for Collection and cannot be null"); + } + this.Name = name; + this.VectorsCount = vectorsCount; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets VectorsCount + /// + [DataMember(Name = "vectors_count", IsRequired = true, EmitDefaultValue = true)] + public int VectorsCount { 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 Collection {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" VectorsCount: ").Append(VectorsCount).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/src/CheshireCatApi/Model/CollectionData.cs b/src/CheshireCatApi/Model/CollectionData.cs new file mode 100644 index 0000000..c0c1cfd --- /dev/null +++ b/src/CheshireCatApi/Model/CollectionData.cs @@ -0,0 +1,143 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// CollectionData + /// + [DataContract(Name = "CollectionData")] + public partial class CollectionData : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected CollectionData() { } + /// + /// Initializes a new instance of the class. + /// + /// pageContent (required). + /// metadata (required). + /// id (required). + /// score (required). + /// vector (required). + public CollectionData(string pageContent = default(string), MetaData metadata = default(MetaData), string id = default(string), int score = default(int), List vector = default(List)) + { + // to ensure "pageContent" is required (not null) + if (pageContent == null) + { + throw new ArgumentNullException("pageContent is a required property for CollectionData and cannot be null"); + } + this.PageContent = pageContent; + // to ensure "metadata" is required (not null) + if (metadata == null) + { + throw new ArgumentNullException("metadata is a required property for CollectionData and cannot be null"); + } + this.Metadata = metadata; + // to ensure "id" is required (not null) + if (id == null) + { + throw new ArgumentNullException("id is a required property for CollectionData and cannot be null"); + } + this.Id = id; + this.Score = score; + // to ensure "vector" is required (not null) + if (vector == null) + { + throw new ArgumentNullException("vector is a required property for CollectionData and cannot be null"); + } + this.Vector = vector; + } + + /// + /// Gets or Sets PageContent + /// + [DataMember(Name = "page_content", IsRequired = true, EmitDefaultValue = true)] + public string PageContent { get; set; } + + /// + /// Gets or Sets Metadata + /// + [DataMember(Name = "metadata", IsRequired = true, EmitDefaultValue = true)] + public MetaData Metadata { get; set; } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] + public string Id { get; set; } + + /// + /// Gets or Sets Score + /// + [DataMember(Name = "score", IsRequired = true, EmitDefaultValue = true)] + public int Score { get; set; } + + /// + /// Gets or Sets Vector + /// + [DataMember(Name = "vector", IsRequired = true, EmitDefaultValue = true)] + public List Vector { 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 CollectionData {\n"); + sb.Append(" PageContent: ").Append(PageContent).Append("\n"); + sb.Append(" Metadata: ").Append(Metadata).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Score: ").Append(Score).Append("\n"); + sb.Append(" Vector: ").Append(Vector).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/src/CheshireCatApi/Model/CollectionsList.cs b/src/CheshireCatApi/Model/CollectionsList.cs new file mode 100644 index 0000000..a401168 --- /dev/null +++ b/src/CheshireCatApi/Model/CollectionsList.cs @@ -0,0 +1,92 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// CollectionsList + /// + [DataContract(Name = "CollectionsList")] + public partial class CollectionsList : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected CollectionsList() { } + /// + /// Initializes a new instance of the class. + /// + /// collections (required). + public CollectionsList(List collections = default(List)) + { + // to ensure "collections" is required (not null) + if (collections == null) + { + throw new ArgumentNullException("collections is a required property for CollectionsList and cannot be null"); + } + this.Collections = collections; + } + + /// + /// Gets or Sets Collections + /// + [DataMember(Name = "collections", IsRequired = true, EmitDefaultValue = true)] + public List Collections { 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 CollectionsList {\n"); + sb.Append(" Collections: ").Append(Collections).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/src/CheshireCatApi/Model/ConversationHistory.cs b/src/CheshireCatApi/Model/ConversationHistory.cs new file mode 100644 index 0000000..f54f1bb --- /dev/null +++ b/src/CheshireCatApi/Model/ConversationHistory.cs @@ -0,0 +1,92 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// ConversationHistory + /// + [DataContract(Name = "ConversationHistory")] + public partial class ConversationHistory : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ConversationHistory() { } + /// + /// Initializes a new instance of the class. + /// + /// history (required). + public ConversationHistory(List history = default(List)) + { + // to ensure "history" is required (not null) + if (history == null) + { + throw new ArgumentNullException("history is a required property for ConversationHistory and cannot be null"); + } + this.History = history; + } + + /// + /// Gets or Sets History + /// + [DataMember(Name = "history", IsRequired = true, EmitDefaultValue = true)] + public List History { 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 ConversationHistory {\n"); + sb.Append(" History: ").Append(History).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/src/CheshireCatApi/Model/ConversationMessage.cs b/src/CheshireCatApi/Model/ConversationMessage.cs new file mode 100644 index 0000000..e726c43 --- /dev/null +++ b/src/CheshireCatApi/Model/ConversationMessage.cs @@ -0,0 +1,115 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// ConversationMessage + /// + [DataContract(Name = "ConversationMessage")] + public partial class ConversationMessage : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ConversationMessage() { } + /// + /// Initializes a new instance of the class. + /// + /// who (required). + /// message (required). + /// why. + public ConversationMessage(string who = default(string), string message = default(string), Object why = default(Object)) + { + // to ensure "who" is required (not null) + if (who == null) + { + throw new ArgumentNullException("who is a required property for ConversationMessage and cannot be null"); + } + this.Who = who; + // to ensure "message" is required (not null) + if (message == null) + { + throw new ArgumentNullException("message is a required property for ConversationMessage and cannot be null"); + } + this.Message = message; + this.Why = why; + } + + /// + /// Gets or Sets Who + /// + [DataMember(Name = "who", IsRequired = true, EmitDefaultValue = true)] + public string Who { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name = "message", IsRequired = true, EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Gets or Sets Why + /// + [DataMember(Name = "why", EmitDefaultValue = false)] + public Object Why { 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 ConversationMessage {\n"); + sb.Append(" Who: ").Append(Who).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Why: ").Append(Why).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/src/CheshireCatApi/Model/Detail.cs b/src/CheshireCatApi/Model/Detail.cs new file mode 100644 index 0000000..84a1faa --- /dev/null +++ b/src/CheshireCatApi/Model/Detail.cs @@ -0,0 +1,92 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// Detail + /// + [DataContract(Name = "Detail")] + public partial class Detail : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Detail() { } + /// + /// Initializes a new instance of the class. + /// + /// error (required). + public Detail(string error = default(string)) + { + // to ensure "error" is required (not null) + if (error == null) + { + throw new ArgumentNullException("error is a required property for Detail and cannot be null"); + } + this.Error = error; + } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", IsRequired = true, EmitDefaultValue = true)] + public string Error { 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 Detail {\n"); + sb.Append(" Error: ").Append(Error).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/src/CheshireCatApi/Model/FileResponse.cs b/src/CheshireCatApi/Model/FileResponse.cs new file mode 100644 index 0000000..121b2d3 --- /dev/null +++ b/src/CheshireCatApi/Model/FileResponse.cs @@ -0,0 +1,120 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// FileResponse + /// + [DataContract(Name = "FileResponse")] + public partial class FileResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FileResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// filename (required). + /// contentType (required). + /// info (required). + public FileResponse(string filename = default(string), string contentType = default(string), string info = default(string)) + { + // to ensure "filename" is required (not null) + if (filename == null) + { + throw new ArgumentNullException("filename is a required property for FileResponse and cannot be null"); + } + this.Filename = filename; + // to ensure "contentType" is required (not null) + if (contentType == null) + { + throw new ArgumentNullException("contentType is a required property for FileResponse and cannot be null"); + } + this.ContentType = contentType; + // to ensure "info" is required (not null) + if (info == null) + { + throw new ArgumentNullException("info is a required property for FileResponse and cannot be null"); + } + this.Info = info; + } + + /// + /// Gets or Sets Filename + /// + [DataMember(Name = "filename", IsRequired = true, EmitDefaultValue = true)] + public string Filename { get; set; } + + /// + /// Gets or Sets ContentType + /// + [DataMember(Name = "content_type", IsRequired = true, EmitDefaultValue = true)] + public string ContentType { get; set; } + + /// + /// Gets or Sets Info + /// + [DataMember(Name = "info", IsRequired = true, EmitDefaultValue = true)] + public string Info { 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 FileResponse {\n"); + sb.Append(" Filename: ").Append(Filename).Append("\n"); + sb.Append(" ContentType: ").Append(ContentType).Append("\n"); + sb.Append(" Info: ").Append(Info).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/src/CheshireCatApi/Model/Filters.cs b/src/CheshireCatApi/Model/Filters.cs new file mode 100644 index 0000000..66156ac --- /dev/null +++ b/src/CheshireCatApi/Model/Filters.cs @@ -0,0 +1,82 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// Filters + /// + [DataContract(Name = "Filters")] + public partial class Filters : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// query. + public Filters(string query = default(string)) + { + this.Query = query; + } + + /// + /// Gets or Sets Query + /// + [DataMember(Name = "query", EmitDefaultValue = true)] + public string Query { 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 Filters {\n"); + sb.Append(" Query: ").Append(Query).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/src/CheshireCatApi/Model/GetPluginSettings200Response.cs b/src/CheshireCatApi/Model/GetPluginSettings200Response.cs new file mode 100644 index 0000000..14ebb29 --- /dev/null +++ b/src/CheshireCatApi/Model/GetPluginSettings200Response.cs @@ -0,0 +1,120 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// GetPluginSettings200Response + /// + [DataContract(Name = "get_plugin_settings_200_response")] + public partial class GetPluginSettings200Response : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected GetPluginSettings200Response() { } + /// + /// Initializes a new instance of the class. + /// + /// name (required). + /// value (required). + /// schema (required). + public GetPluginSettings200Response(string name = default(string), Object value = default(Object), Object schema = default(Object)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for GetPluginSettings200Response and cannot be null"); + } + this.Name = name; + // to ensure "value" is required (not null) + if (value == null) + { + throw new ArgumentNullException("value is a required property for GetPluginSettings200Response and cannot be null"); + } + this.Value = value; + // to ensure "schema" is required (not null) + if (schema == null) + { + throw new ArgumentNullException("schema is a required property for GetPluginSettings200Response and cannot be null"); + } + this.Schema = schema; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Value + /// + [DataMember(Name = "value", IsRequired = true, EmitDefaultValue = true)] + public Object Value { get; set; } + + /// + /// Gets or Sets Schema + /// + [DataMember(Name = "schema", IsRequired = true, EmitDefaultValue = true)] + public Object Schema { 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 GetPluginSettings200Response {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" Schema: ").Append(Schema).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/src/CheshireCatApi/Model/HTTPValidationError.cs b/src/CheshireCatApi/Model/HTTPValidationError.cs new file mode 100644 index 0000000..ca1a6a2 --- /dev/null +++ b/src/CheshireCatApi/Model/HTTPValidationError.cs @@ -0,0 +1,82 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// HTTPValidationError + /// + [DataContract(Name = "HTTPValidationError")] + public partial class HTTPValidationError : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// detail. + public HTTPValidationError(Detail detail = default(Detail)) + { + this.Detail = detail; + } + + /// + /// Gets or Sets Detail + /// + [DataMember(Name = "detail", EmitDefaultValue = false)] + public Detail Detail { 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 HTTPValidationError {\n"); + sb.Append(" Detail: ").Append(Detail).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/src/CheshireCatApi/Model/HooksInner.cs b/src/CheshireCatApi/Model/HooksInner.cs new file mode 100644 index 0000000..0acb886 --- /dev/null +++ b/src/CheshireCatApi/Model/HooksInner.cs @@ -0,0 +1,101 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// HooksInner + /// + [DataContract(Name = "Hooks_inner")] + public partial class HooksInner : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected HooksInner() { } + /// + /// Initializes a new instance of the class. + /// + /// name (required). + /// priority (required). + public HooksInner(string name = default(string), int priority = default(int)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for HooksInner and cannot be null"); + } + this.Name = name; + this.Priority = priority; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Priority + /// + [DataMember(Name = "priority", IsRequired = true, EmitDefaultValue = true)] + public int Priority { 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 HooksInner {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Priority: ").Append(Priority).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/src/CheshireCatApi/Model/MemoryRecall.cs b/src/CheshireCatApi/Model/MemoryRecall.cs new file mode 100644 index 0000000..7c55ae7 --- /dev/null +++ b/src/CheshireCatApi/Model/MemoryRecall.cs @@ -0,0 +1,106 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// MemoryRecall + /// + [DataContract(Name = "MemoryRecall")] + public partial class MemoryRecall : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MemoryRecall() { } + /// + /// Initializes a new instance of the class. + /// + /// query (required). + /// vectors (required). + public MemoryRecall(QueryData query = default(QueryData), VectorsData vectors = default(VectorsData)) + { + // to ensure "query" is required (not null) + if (query == null) + { + throw new ArgumentNullException("query is a required property for MemoryRecall and cannot be null"); + } + this.Query = query; + // to ensure "vectors" is required (not null) + if (vectors == null) + { + throw new ArgumentNullException("vectors is a required property for MemoryRecall and cannot be null"); + } + this.Vectors = vectors; + } + + /// + /// Gets or Sets Query + /// + [DataMember(Name = "query", IsRequired = true, EmitDefaultValue = true)] + public QueryData Query { get; set; } + + /// + /// Gets or Sets Vectors + /// + [DataMember(Name = "vectors", IsRequired = true, EmitDefaultValue = true)] + public VectorsData Vectors { 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 MemoryRecall {\n"); + sb.Append(" Query: ").Append(Query).Append("\n"); + sb.Append(" Vectors: ").Append(Vectors).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/src/CheshireCatApi/Model/MetaData.cs b/src/CheshireCatApi/Model/MetaData.cs new file mode 100644 index 0000000..0d6a11a --- /dev/null +++ b/src/CheshireCatApi/Model/MetaData.cs @@ -0,0 +1,119 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// MetaData + /// + [DataContract(Name = "MetaData")] + public partial class MetaData : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MetaData() { } + /// + /// Initializes a new instance of the class. + /// + /// source (required). + /// when (required). + /// docstring. + /// name. + public MetaData(string source = default(string), int when = default(int), string docstring = default(string), string name = default(string)) + { + // to ensure "source" is required (not null) + if (source == null) + { + throw new ArgumentNullException("source is a required property for MetaData and cannot be null"); + } + this.Source = source; + this.When = when; + this.Docstring = docstring; + this.Name = name; + } + + /// + /// Gets or Sets Source + /// + [DataMember(Name = "source", IsRequired = true, EmitDefaultValue = true)] + public string Source { get; set; } + + /// + /// Gets or Sets When + /// + [DataMember(Name = "when", IsRequired = true, EmitDefaultValue = true)] + public int When { get; set; } + + /// + /// Gets or Sets Docstring + /// + [DataMember(Name = "docstring", EmitDefaultValue = false)] + public string Docstring { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { 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 MetaData {\n"); + sb.Append(" Source: ").Append(Source).Append("\n"); + sb.Append(" When: ").Append(When).Append("\n"); + sb.Append(" Docstring: ").Append(Docstring).Append("\n"); + sb.Append(" Name: ").Append(Name).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/src/CheshireCatApi/Model/Plugin.cs b/src/CheshireCatApi/Model/Plugin.cs new file mode 100644 index 0000000..e72c30b --- /dev/null +++ b/src/CheshireCatApi/Model/Plugin.cs @@ -0,0 +1,249 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// Plugin + /// + [DataContract(Name = "Plugin")] + public partial class Plugin : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Plugin() { } + /// + /// Initializes a new instance of the class. + /// + /// id (required). + /// name (required). + /// description (required). + /// authorName (required). + /// authorUrl (required). + /// pluginUrl (required). + /// tags (required). + /// thumb (required). + /// varVersion (required). + /// active. + /// url. + /// upgrade. + /// hooks. + /// tools. + public Plugin(string id = default(string), string name = default(string), string description = default(string), string authorName = default(string), string authorUrl = default(string), string pluginUrl = default(string), string tags = default(string), string thumb = default(string), string varVersion = default(string), bool active = default(bool), string url = default(string), string upgrade = default(string), List hooks = default(List), List tools = default(List)) + { + // to ensure "id" is required (not null) + if (id == null) + { + throw new ArgumentNullException("id is a required property for Plugin and cannot be null"); + } + this.Id = id; + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for Plugin and cannot be null"); + } + this.Name = name; + // to ensure "description" is required (not null) + if (description == null) + { + throw new ArgumentNullException("description is a required property for Plugin and cannot be null"); + } + this.Description = description; + // to ensure "authorName" is required (not null) + if (authorName == null) + { + throw new ArgumentNullException("authorName is a required property for Plugin and cannot be null"); + } + this.AuthorName = authorName; + // to ensure "authorUrl" is required (not null) + if (authorUrl == null) + { + throw new ArgumentNullException("authorUrl is a required property for Plugin and cannot be null"); + } + this.AuthorUrl = authorUrl; + // to ensure "pluginUrl" is required (not null) + if (pluginUrl == null) + { + throw new ArgumentNullException("pluginUrl is a required property for Plugin and cannot be null"); + } + this.PluginUrl = pluginUrl; + // to ensure "tags" is required (not null) + if (tags == null) + { + throw new ArgumentNullException("tags is a required property for Plugin and cannot be null"); + } + this.Tags = tags; + // to ensure "thumb" is required (not null) + if (thumb == null) + { + throw new ArgumentNullException("thumb is a required property for Plugin and cannot be null"); + } + this.Thumb = thumb; + // to ensure "varVersion" is required (not null) + if (varVersion == null) + { + throw new ArgumentNullException("varVersion is a required property for Plugin and cannot be null"); + } + this.VarVersion = varVersion; + this.Active = active; + this.Url = url; + this.Upgrade = upgrade; + this.Hooks = hooks; + this.Tools = tools; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] + public string Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", IsRequired = true, EmitDefaultValue = true)] + public string Description { get; set; } + + /// + /// Gets or Sets AuthorName + /// + [DataMember(Name = "author_name", IsRequired = true, EmitDefaultValue = true)] + public string AuthorName { get; set; } + + /// + /// Gets or Sets AuthorUrl + /// + [DataMember(Name = "author_url", IsRequired = true, EmitDefaultValue = true)] + public string AuthorUrl { get; set; } + + /// + /// Gets or Sets PluginUrl + /// + [DataMember(Name = "plugin_url", IsRequired = true, EmitDefaultValue = true)] + public string PluginUrl { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name = "tags", IsRequired = true, EmitDefaultValue = true)] + public string Tags { get; set; } + + /// + /// Gets or Sets Thumb + /// + [DataMember(Name = "thumb", IsRequired = true, EmitDefaultValue = true)] + public string Thumb { get; set; } + + /// + /// Gets or Sets VarVersion + /// + [DataMember(Name = "version", IsRequired = true, EmitDefaultValue = true)] + public string VarVersion { get; set; } + + /// + /// Gets or Sets Active + /// + [DataMember(Name = "active", EmitDefaultValue = true)] + public bool Active { get; set; } + + /// + /// Gets or Sets Url + /// + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { get; set; } + + /// + /// Gets or Sets Upgrade + /// + [DataMember(Name = "upgrade", EmitDefaultValue = false)] + public string Upgrade { get; set; } + + /// + /// Gets or Sets Hooks + /// + [DataMember(Name = "hooks", EmitDefaultValue = false)] + public List Hooks { get; set; } + + /// + /// Gets or Sets Tools + /// + [DataMember(Name = "tools", EmitDefaultValue = false)] + public List Tools { 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 Plugin {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" AuthorName: ").Append(AuthorName).Append("\n"); + sb.Append(" AuthorUrl: ").Append(AuthorUrl).Append("\n"); + sb.Append(" PluginUrl: ").Append(PluginUrl).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Thumb: ").Append(Thumb).Append("\n"); + sb.Append(" VarVersion: ").Append(VarVersion).Append("\n"); + sb.Append(" Active: ").Append(Active).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append(" Upgrade: ").Append(Upgrade).Append("\n"); + sb.Append(" Hooks: ").Append(Hooks).Append("\n"); + sb.Append(" Tools: ").Append(Tools).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/src/CheshireCatApi/Model/PluginsList.cs b/src/CheshireCatApi/Model/PluginsList.cs new file mode 100644 index 0000000..3e1d12d --- /dev/null +++ b/src/CheshireCatApi/Model/PluginsList.cs @@ -0,0 +1,120 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// PluginsList + /// + [DataContract(Name = "PluginsList")] + public partial class PluginsList : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected PluginsList() { } + /// + /// Initializes a new instance of the class. + /// + /// filters (required). + /// installed (required). + /// registry (required). + public PluginsList(Filters filters = default(Filters), List installed = default(List), List registry = default(List)) + { + // to ensure "filters" is required (not null) + if (filters == null) + { + throw new ArgumentNullException("filters is a required property for PluginsList and cannot be null"); + } + this.Filters = filters; + // to ensure "installed" is required (not null) + if (installed == null) + { + throw new ArgumentNullException("installed is a required property for PluginsList and cannot be null"); + } + this.Installed = installed; + // to ensure "registry" is required (not null) + if (registry == null) + { + throw new ArgumentNullException("registry is a required property for PluginsList and cannot be null"); + } + this.Registry = registry; + } + + /// + /// Gets or Sets Filters + /// + [DataMember(Name = "filters", IsRequired = true, EmitDefaultValue = true)] + public Filters Filters { get; set; } + + /// + /// Gets or Sets Installed + /// + [DataMember(Name = "installed", IsRequired = true, EmitDefaultValue = true)] + public List Installed { get; set; } + + /// + /// Gets or Sets Registry + /// + [DataMember(Name = "registry", IsRequired = true, EmitDefaultValue = true)] + public List Registry { 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 PluginsList {\n"); + sb.Append(" Filters: ").Append(Filters).Append("\n"); + sb.Append(" Installed: ").Append(Installed).Append("\n"); + sb.Append(" Registry: ").Append(Registry).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/src/CheshireCatApi/Model/QueryData.cs b/src/CheshireCatApi/Model/QueryData.cs new file mode 100644 index 0000000..d6e9b54 --- /dev/null +++ b/src/CheshireCatApi/Model/QueryData.cs @@ -0,0 +1,106 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// QueryData + /// + [DataContract(Name = "QueryData")] + public partial class QueryData : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected QueryData() { } + /// + /// Initializes a new instance of the class. + /// + /// text (required). + /// vector (required). + public QueryData(string text = default(string), List vector = default(List)) + { + // to ensure "text" is required (not null) + if (text == null) + { + throw new ArgumentNullException("text is a required property for QueryData and cannot be null"); + } + this.Text = text; + // to ensure "vector" is required (not null) + if (vector == null) + { + throw new ArgumentNullException("vector is a required property for QueryData and cannot be null"); + } + this.Vector = vector; + } + + /// + /// Gets or Sets Text + /// + [DataMember(Name = "text", IsRequired = true, EmitDefaultValue = true)] + public string Text { get; set; } + + /// + /// Gets or Sets Vector + /// + [DataMember(Name = "vector", IsRequired = true, EmitDefaultValue = true)] + public List Vector { 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 QueryData {\n"); + sb.Append(" Text: ").Append(Text).Append("\n"); + sb.Append(" Vector: ").Append(Vector).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/src/CheshireCatApi/Model/ResponseGetAllowedMimetypes.cs b/src/CheshireCatApi/Model/ResponseGetAllowedMimetypes.cs new file mode 100644 index 0000000..849779e --- /dev/null +++ b/src/CheshireCatApi/Model/ResponseGetAllowedMimetypes.cs @@ -0,0 +1,82 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// ResponseGetAllowedMimetypes + /// + [DataContract(Name = "Response_Get_Allowed_Mimetypes")] + public partial class ResponseGetAllowedMimetypes : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// allowed. + public ResponseGetAllowedMimetypes(List allowed = default(List)) + { + this.Allowed = allowed; + } + + /// + /// Gets or Sets Allowed + /// + [DataMember(Name = "allowed", EmitDefaultValue = false)] + public List Allowed { 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 ResponseGetAllowedMimetypes {\n"); + sb.Append(" Allowed: ").Append(Allowed).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/src/CheshireCatApi/Model/Setting.cs b/src/CheshireCatApi/Model/Setting.cs new file mode 100644 index 0000000..6bc9549 --- /dev/null +++ b/src/CheshireCatApi/Model/Setting.cs @@ -0,0 +1,115 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// Setting + /// + [DataContract(Name = "Setting")] + public partial class Setting : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Setting() { } + /// + /// Initializes a new instance of the class. + /// + /// name (required). + /// value (required). + /// schema. + public Setting(string name = default(string), Object value = default(Object), Object schema = default(Object)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for Setting and cannot be null"); + } + this.Name = name; + // to ensure "value" is required (not null) + if (value == null) + { + throw new ArgumentNullException("value is a required property for Setting and cannot be null"); + } + this.Value = value; + this.Schema = schema; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Value + /// + [DataMember(Name = "value", IsRequired = true, EmitDefaultValue = true)] + public Object Value { get; set; } + + /// + /// Gets or Sets Schema + /// + [DataMember(Name = "schema", EmitDefaultValue = false)] + public Object Schema { 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 Setting {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" Schema: ").Append(Schema).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/src/CheshireCatApi/Model/SettingBody.cs b/src/CheshireCatApi/Model/SettingBody.cs new file mode 100644 index 0000000..fa3b51b --- /dev/null +++ b/src/CheshireCatApi/Model/SettingBody.cs @@ -0,0 +1,115 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// SettingBody + /// + [DataContract(Name = "SettingBody")] + public partial class SettingBody : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SettingBody() { } + /// + /// Initializes a new instance of the class. + /// + /// name (required). + /// value (required). + /// category. + public SettingBody(string name = default(string), Object value = default(Object), string category = default(string)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for SettingBody and cannot be null"); + } + this.Name = name; + // to ensure "value" is required (not null) + if (value == null) + { + throw new ArgumentNullException("value is a required property for SettingBody and cannot be null"); + } + this.Value = value; + this.Category = category; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Value + /// + [DataMember(Name = "value", IsRequired = true, EmitDefaultValue = true)] + public Object Value { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name = "category", EmitDefaultValue = false)] + public string Category { 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 SettingBody {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" Category: ").Append(Category).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/src/CheshireCatApi/Model/SettingsResponse.cs b/src/CheshireCatApi/Model/SettingsResponse.cs new file mode 100644 index 0000000..cfb6328 --- /dev/null +++ b/src/CheshireCatApi/Model/SettingsResponse.cs @@ -0,0 +1,101 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// SettingsResponse + /// + [DataContract(Name = "SettingsResponse")] + public partial class SettingsResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SettingsResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// settings (required). + /// selectedConfiguration. + public SettingsResponse(List settings = default(List), string selectedConfiguration = default(string)) + { + // to ensure "settings" is required (not null) + if (settings == null) + { + throw new ArgumentNullException("settings is a required property for SettingsResponse and cannot be null"); + } + this.Settings = settings; + this.SelectedConfiguration = selectedConfiguration; + } + + /// + /// Gets or Sets Settings + /// + [DataMember(Name = "settings", IsRequired = true, EmitDefaultValue = true)] + public List Settings { get; set; } + + /// + /// Gets or Sets SelectedConfiguration + /// + [DataMember(Name = "selected_configuration", EmitDefaultValue = false)] + public string SelectedConfiguration { 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 SettingsResponse {\n"); + sb.Append(" Settings: ").Append(Settings).Append("\n"); + sb.Append(" SelectedConfiguration: ").Append(SelectedConfiguration).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/src/CheshireCatApi/Model/Status.cs b/src/CheshireCatApi/Model/Status.cs new file mode 100644 index 0000000..a00b400 --- /dev/null +++ b/src/CheshireCatApi/Model/Status.cs @@ -0,0 +1,106 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// Status + /// + [DataContract(Name = "Status")] + public partial class Status : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Status() { } + /// + /// Initializes a new instance of the class. + /// + /// varStatus (required). + /// varVersion (required). + public Status(string varStatus = default(string), string varVersion = default(string)) + { + // to ensure "varStatus" is required (not null) + if (varStatus == null) + { + throw new ArgumentNullException("varStatus is a required property for Status and cannot be null"); + } + this.VarStatus = varStatus; + // to ensure "varVersion" is required (not null) + if (varVersion == null) + { + throw new ArgumentNullException("varVersion is a required property for Status and cannot be null"); + } + this.VarVersion = varVersion; + } + + /// + /// Gets or Sets VarStatus + /// + [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = true)] + public string VarStatus { get; set; } + + /// + /// Gets or Sets VarVersion + /// + [DataMember(Name = "version", IsRequired = true, EmitDefaultValue = true)] + public string VarVersion { 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 Status {\n"); + sb.Append(" VarStatus: ").Append(VarStatus).Append("\n"); + sb.Append(" VarVersion: ").Append(VarVersion).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/src/CheshireCatApi/Model/ToggleResponse.cs b/src/CheshireCatApi/Model/ToggleResponse.cs new file mode 100644 index 0000000..9b96231 --- /dev/null +++ b/src/CheshireCatApi/Model/ToggleResponse.cs @@ -0,0 +1,92 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// ToggleResponse + /// + [DataContract(Name = "ToggleResponse")] + public partial class ToggleResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ToggleResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// info (required). + public ToggleResponse(string info = default(string)) + { + // to ensure "info" is required (not null) + if (info == null) + { + throw new ArgumentNullException("info is a required property for ToggleResponse and cannot be null"); + } + this.Info = info; + } + + /// + /// Gets or Sets Info + /// + [DataMember(Name = "info", IsRequired = true, EmitDefaultValue = true)] + public string Info { 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 ToggleResponse {\n"); + sb.Append(" Info: ").Append(Info).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/src/CheshireCatApi/Model/ToolsInner.cs b/src/CheshireCatApi/Model/ToolsInner.cs new file mode 100644 index 0000000..d685b55 --- /dev/null +++ b/src/CheshireCatApi/Model/ToolsInner.cs @@ -0,0 +1,92 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// ToolsInner + /// + [DataContract(Name = "Tools_inner")] + public partial class ToolsInner : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ToolsInner() { } + /// + /// Initializes a new instance of the class. + /// + /// name (required). + public ToolsInner(string name = default(string)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for ToolsInner and cannot be null"); + } + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { 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 ToolsInner {\n"); + sb.Append(" Name: ").Append(Name).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/src/CheshireCatApi/Model/VectorsData.cs b/src/CheshireCatApi/Model/VectorsData.cs new file mode 100644 index 0000000..aacf711 --- /dev/null +++ b/src/CheshireCatApi/Model/VectorsData.cs @@ -0,0 +1,106 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// VectorsData + /// + [DataContract(Name = "VectorsData")] + public partial class VectorsData : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected VectorsData() { } + /// + /// Initializes a new instance of the class. + /// + /// embedder (required). + /// collections (required). + public VectorsData(string embedder = default(string), Dictionary> collections = default(Dictionary>)) + { + // to ensure "embedder" is required (not null) + if (embedder == null) + { + throw new ArgumentNullException("embedder is a required property for VectorsData and cannot be null"); + } + this.Embedder = embedder; + // to ensure "collections" is required (not null) + if (collections == null) + { + throw new ArgumentNullException("collections is a required property for VectorsData and cannot be null"); + } + this.Collections = collections; + } + + /// + /// Gets or Sets Embedder + /// + [DataMember(Name = "embedder", IsRequired = true, EmitDefaultValue = true)] + public string Embedder { get; set; } + + /// + /// Gets or Sets Collections + /// + [DataMember(Name = "collections", IsRequired = true, EmitDefaultValue = true)] + public Dictionary> Collections { 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 VectorsData {\n"); + sb.Append(" Embedder: ").Append(Embedder).Append("\n"); + sb.Append(" Collections: ").Append(Collections).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/src/CheshireCatApi/Model/WebResponse.cs b/src/CheshireCatApi/Model/WebResponse.cs new file mode 100644 index 0000000..16a75cc --- /dev/null +++ b/src/CheshireCatApi/Model/WebResponse.cs @@ -0,0 +1,106 @@ +/* + * 😸 Cheshire-Cat API + * + * Customizable AI architecture + * + * The version of the OpenAPI document: 0.0.5 + * 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 = CheshireCatApi.Client.OpenAPIDateConverter; + +namespace CheshireCatApi.Model +{ + /// + /// WebResponse + /// + [DataContract(Name = "WebResponse")] + public partial class WebResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected WebResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// url (required). + /// info (required). + public WebResponse(string url = default(string), string info = default(string)) + { + // to ensure "url" is required (not null) + if (url == null) + { + throw new ArgumentNullException("url is a required property for WebResponse and cannot be null"); + } + this.Url = url; + // to ensure "info" is required (not null) + if (info == null) + { + throw new ArgumentNullException("info is a required property for WebResponse and cannot be null"); + } + this.Info = info; + } + + /// + /// Gets or Sets Url + /// + [DataMember(Name = "url", IsRequired = true, EmitDefaultValue = true)] + public string Url { get; set; } + + /// + /// Gets or Sets Info + /// + [DataMember(Name = "info", IsRequired = true, EmitDefaultValue = true)] + public string Info { 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 WebResponse {\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append(" Info: ").Append(Info).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; + } + } + +}