From ba3134f06cac71e96958880f3fa22c5de5bc8a03 Mon Sep 17 00:00:00 2001 From: Alexandr Morogov <42555001+krankenbro@users.noreply.github.com> Date: Tue, 9 Jan 2024 09:01:15 +0100 Subject: [PATCH] VCI-752: Virtocloud client (#111) --- VirtoCommerce.Build.sln | 9 + src/VirtoCommerce.Build/Cloud/Build.SaaS.cs | 147 +- .../VirtoCommerce.Build.csproj | 4 + src/Virtocloud.Client/.gitignore | 362 ++ .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 45 + .../.openapi-generator/VERSION | 1 + src/Virtocloud.Client/README.md | 199 + src/Virtocloud.Client/VirtoCloud.Client.sln | 27 + src/Virtocloud.Client/api/openapi.yaml | 872 +++ src/Virtocloud.Client/appveyor.yml | 9 + .../docs/CloudEnvironment.md | 21 + .../docs/EnvironmentNameValidationRequest.md | 11 + src/Virtocloud.Client/docs/Helm.md | 10 + src/Virtocloud.Client/docs/HelmObject.md | 10 + .../docs/NewEnvironmentModel.md | 16 + .../docs/SaaSDeploymentApi.md | 3011 +++++++++ src/Virtocloud.Client/git_push.sh | 57 + .../Api/SaaSDeploymentApiTests.cs | 413 ++ .../Model/CloudEnvironmentTests.cs | 165 + .../EnvironmentNameValidationRequestTests.cs | 75 + .../Model/HelmObjectTests.cs | 66 + .../VirtoCloud.Client.Test/Model/HelmTests.cs | 66 + .../Model/NewEnvironmentModelTests.cs | 120 + .../VirtoCloud.Client.Test.csproj | 20 + .../Api/SaaSDeploymentApi.cs | 5453 +++++++++++++++++ .../src/VirtoCloud.Client/Client/ApiClient.cs | 764 +++ .../VirtoCloud.Client/Client/ApiException.cs | 68 + .../VirtoCloud.Client/Client/ApiResponse.cs | 166 + .../VirtoCloud.Client/Client/ClientUtils.cs | 247 + .../VirtoCloud.Client/Client/Configuration.cs | 612 ++ .../Client/ExceptionFactory.cs | 22 + .../VirtoCloud.Client/Client/FileParameter.cs | 80 + .../Client/GlobalConfiguration.cs | 67 + .../VirtoCloud.Client/Client/IApiAccessor.cs | 37 + .../Client/IAsynchronousClient.cs | 100 + .../Client/IReadableConfiguration.cs | 141 + .../Client/ISynchronousClient.cs | 93 + .../src/VirtoCloud.Client/Client/Multimap.cs | 295 + .../Client/OpenAPIDateConverter.cs | 29 + .../Client/RequestOptions.cs | 74 + .../Client/RetryConfiguration.cs | 31 + .../Client/WebRequestPathBuilder.cs | 53 + .../Model/AbstractOpenAPISchema.cs | 76 + .../Model/CloudEnvironment.cs | 329 + .../Model/EnvironmentNameValidationRequest.cs | 147 + .../src/VirtoCloud.Client/Model/Helm.cs | 130 + .../src/VirtoCloud.Client/Model/HelmObject.cs | 130 + .../Model/NewEnvironmentModel.cs | 237 + .../VirtoCloud.Client.csproj | 35 + 50 files changed, 15167 insertions(+), 8 deletions(-) create mode 100644 src/Virtocloud.Client/.gitignore create mode 100644 src/Virtocloud.Client/.openapi-generator-ignore create mode 100644 src/Virtocloud.Client/.openapi-generator/FILES create mode 100644 src/Virtocloud.Client/.openapi-generator/VERSION create mode 100644 src/Virtocloud.Client/README.md create mode 100644 src/Virtocloud.Client/VirtoCloud.Client.sln create mode 100644 src/Virtocloud.Client/api/openapi.yaml create mode 100644 src/Virtocloud.Client/appveyor.yml create mode 100644 src/Virtocloud.Client/docs/CloudEnvironment.md create mode 100644 src/Virtocloud.Client/docs/EnvironmentNameValidationRequest.md create mode 100644 src/Virtocloud.Client/docs/Helm.md create mode 100644 src/Virtocloud.Client/docs/HelmObject.md create mode 100644 src/Virtocloud.Client/docs/NewEnvironmentModel.md create mode 100644 src/Virtocloud.Client/docs/SaaSDeploymentApi.md create mode 100644 src/Virtocloud.Client/git_push.sh create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client.Test/Api/SaaSDeploymentApiTests.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/CloudEnvironmentTests.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/EnvironmentNameValidationRequestTests.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/HelmObjectTests.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/HelmTests.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/NewEnvironmentModelTests.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client.Test/VirtoCloud.Client.Test.csproj create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Api/SaaSDeploymentApi.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/ApiClient.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/ApiException.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/ApiResponse.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/ClientUtils.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/Configuration.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/ExceptionFactory.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/FileParameter.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/GlobalConfiguration.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/IApiAccessor.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/IAsynchronousClient.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/IReadableConfiguration.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/ISynchronousClient.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/Multimap.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/OpenAPIDateConverter.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/RequestOptions.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/RetryConfiguration.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Client/WebRequestPathBuilder.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Model/AbstractOpenAPISchema.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Model/CloudEnvironment.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Model/EnvironmentNameValidationRequest.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Model/Helm.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Model/HelmObject.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/Model/NewEnvironmentModel.cs create mode 100644 src/Virtocloud.Client/src/VirtoCloud.Client/VirtoCloud.Client.csproj diff --git a/VirtoCommerce.Build.sln b/VirtoCommerce.Build.sln index 6fe0297..23349c6 100644 --- a/VirtoCommerce.Build.sln +++ b/VirtoCommerce.Build.sln @@ -4,9 +4,14 @@ Microsoft Visual Studio Solution File, Format Version 12.00 VisualStudioVersion = 17.0.32112.339 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VirtoCommerce.Build", "src\VirtoCommerce.Build\VirtoCommerce.Build.csproj", "{826FB1DE-BF4F-4314-AA00-FC5BC7627D7F}" + ProjectSection(ProjectDependencies) = postProject + {46099661-167D-4212-AFBE-855179D6F67D} = {46099661-167D-4212-AFBE-855179D6F67D} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VirtoCommerce.Build.Tests", "src\VirtoCommerce.Build.Tests\VirtoCommerce.Build.Tests.csproj", "{9E6E4723-DBA4-4A4B-807D-F9184D792DCF}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VirtoCloud.Client", "src\Virtocloud.Client\src\VirtoCloud.Client\VirtoCloud.Client.csproj", "{46099661-167D-4212-AFBE-855179D6F67D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +26,10 @@ Global {9E6E4723-DBA4-4A4B-807D-F9184D792DCF}.Debug|Any CPU.Build.0 = Debug|Any CPU {9E6E4723-DBA4-4A4B-807D-F9184D792DCF}.Release|Any CPU.ActiveCfg = Release|Any CPU {9E6E4723-DBA4-4A4B-807D-F9184D792DCF}.Release|Any CPU.Build.0 = Release|Any CPU + {46099661-167D-4212-AFBE-855179D6F67D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {46099661-167D-4212-AFBE-855179D6F67D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {46099661-167D-4212-AFBE-855179D6F67D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {46099661-167D-4212-AFBE-855179D6F67D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/VirtoCommerce.Build/Cloud/Build.SaaS.cs b/src/VirtoCommerce.Build/Cloud/Build.SaaS.cs index 537c19f..01021e0 100644 --- a/src/VirtoCommerce.Build/Cloud/Build.SaaS.cs +++ b/src/VirtoCommerce.Build/Cloud/Build.SaaS.cs @@ -2,10 +2,14 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Net.Http; +using System.Security.Policy; +using System.Text.Json.Nodes; +using System.Text; using System.Threading.Tasks; using Cloud.Client; using Cloud.Models; -using Microsoft.Build.Evaluation; +using Microsoft.TeamFoundation.Build.WebApi; using Nuke.Common; using Nuke.Common.IO; using Nuke.Common.ProjectModel; @@ -13,8 +17,11 @@ using Nuke.Common.Tools.Docker; using Nuke.Common.Tools.DotNet; using Serilog; -using VirtoCommerce.Platform.Core.Common; -using Project = Nuke.Common.ProjectModel.Project; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Model; +using System.Net; +using System.Diagnostics; +using Microsoft.AspNetCore.Identity; namespace VirtoCommerce.Build; @@ -45,8 +52,15 @@ internal partial class Build [Parameter("SaaS Portal")] public string CloudUrl { get; set; } = "https://portal.virtocommerce.cloud"; [Parameter("SaaS Token")] public string CloudToken { get; set; } + [Parameter("Path for the file with SaaS Token")] public string CloudTokenFile { get; set; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "vc-build", "cloud"); + [Parameter("SaaS Auth Provider")] public string CloudAuthProvider { get; set; } = "GitHub"; [Parameter("App Project Name")] public string AppProject { get; set; } [Parameter("Cloud Environment Name")] public string EnvironmentName { get; set; } + [Parameter("Cloud Environment Service Plan")] public string ServicePlan { get; set; } + [Parameter("Cloud Environment Cluster Name")] public string ClusterName { get; set; } + [Parameter("Cloud Environment Db Provider")] public string DbProvider { get; set; } + [Parameter("Cloud Environment Db Name")] public string DbName { get; set; } + [Parameter("Organization name", Name = "Organization")] public string SaaSOrganizationName { get; set; } @@ -54,7 +68,7 @@ internal partial class Build .Executes(async () => { var isSuccess = false; - var cloudClient = new VirtoCloudClient(CloudUrl, CloudToken); + var cloudClient = new VirtoCloudClient(CloudUrl, await GetCloudTokenAsync()); for (var i = 0; i < AttemptsNumber; i++) { Log.Information($"Attempt #{i + 1}"); @@ -76,7 +90,7 @@ internal partial class Build public Target SetEnvParameter => _ => _ .Executes(async () => { - var cloudClient = new VirtoCloudClient(CloudUrl, CloudToken); + var cloudClient = new VirtoCloudClient(CloudUrl, await GetCloudTokenAsync()); var env = await cloudClient.GetEnvironment(EnvironmentName, SaaSOrganizationName); var envHelmParameters = env.Helm.Parameters; @@ -91,7 +105,7 @@ internal partial class Build public Target UpdateCloudEnvironment => _ => _ .Executes(async () => { - var cloudClient = new VirtoCloudClient(CloudUrl, CloudToken); + var cloudClient = new VirtoCloudClient(CloudUrl, await GetCloudTokenAsync()); var rawYaml = await File.ReadAllTextAsync(ArgoConfigFile); await cloudClient.UpdateEnvironmentAsync(rawYaml, AppProject); }); @@ -208,11 +222,11 @@ private static bool CheckAppServiceStatus(string expected, string actual) AppsettingsPath = Path.Combine(platformDirectory, "appsettings.json"); }); - public Target DeployImage => _ => _ + public Target CloudDeploy => _ => _ .DependsOn(PrepareDockerContext, BuildAndPush) .Executes(async () => { - var cloudClient = new VirtoCloudClient(CloudUrl, CloudToken); + var cloudClient = new VirtoCloudClient(CloudUrl, await GetCloudTokenAsync()); var env = await cloudClient.GetEnvironment(EnvironmentName, SaaSOrganizationName); var envHelmParameters = env.Helm.Parameters; @@ -222,4 +236,121 @@ private static bool CheckAppServiceStatus(string expected, string actual) await cloudClient.UpdateEnvironmentAsync(env); }); + + public Target CloudAuth => _ => _ + .Executes(async () => + { + var port = "60123"; + var listenerPrefix = $"http://localhost:{port}/"; + + var listener = new HttpListener() { + Prefixes = { listenerPrefix } + }; + Log.Information("Start listening to {0}", listenerPrefix); + listener.Start(); + + + Log.Information("Openning browser window"); + var authUrl = $"{CloudUrl}/externalsignin?authenticationType={CloudAuthProvider}&returnUrl=/api/saas/token/{port}"; + Process.Start(new ProcessStartInfo(authUrl) { UseShellExecute = true }); + + var context = await listener.GetContextAsync(); + context.Response.StatusCode = (int)HttpStatusCode.OK; + var apiKey = context.Request.QueryString["apiKey"]; + context.Response.Close(Encoding.UTF8.GetBytes("You can close this browser tab now."), false); + + SaveCloudToken(apiKey); + }); + + private async Task<string> GetCloudTokenAsync() + { + if (!string.IsNullOrEmpty(CloudToken)) + { + return CloudToken; + } + + if (File.Exists(CloudTokenFile)) + { + return await File.ReadAllTextAsync(CloudTokenFile); + } + + Assert.Fail("Parameter CloudToken is required."); + return string.Empty; // for sonar + } + + private void SaveCloudToken(string token) + { + FileSystemTasks.EnsureExistingDirectory(Path.GetDirectoryName(CloudTokenFile)); + File.WriteAllText(CloudTokenFile, token); + } + + public Target CloudDown => _ => _ + .Requires(() => EnvironmentName) + .Executes(async () => + { + var cloudClient = CreateVirtocloudClient(CloudUrl, await GetCloudTokenAsync()); + var envName = EnvironmentName; + if (!string.IsNullOrWhiteSpace(AppProject)) + { + envName = $"{AppProject}-{EnvironmentName}"; + } + await cloudClient.EnvironmentsDeleteAsync(new List<string> { envName }); + }); + + public Target CloudEnvList => _ => _ + .Executes(async () => + { + var cloudClient = CreateVirtocloudClient(CloudUrl, await GetCloudTokenAsync()); + var envList = await cloudClient.EnvironmentsListAsync(); + Log.Information("There are {0} environments.", envList.Count); + foreach ( var env in envList) + { + Log.Information("{0} - {1}", env.MetadataName, env.Status); + } + }); + + public Target CloudEnvRestart => _ => _ + .Requires(() => EnvironmentName) + .Executes(async () => + { + var cloudClient = CreateVirtocloudClient(CloudUrl, await GetCloudTokenAsync()); + var env = await cloudClient.EnvironmentsGetEnvironmentAsync(EnvironmentName); + Assert.NotNull(env, $"Environment {EnvironmentName} not found."); + + var parameterName = "platform.system.reload"; + env.Helm.Parameters[parameterName] = DateTime.Now.ToString(); + + await cloudClient.EnvironmentsUpdateAsync(env); + }); + + public Target CloudInit => _ => _ + .Before(PrepareDockerContext, BuildAndPush, CloudDeploy) + .Requires(() => ServicePlan, () => EnvironmentName) + .Executes(async () => + { + var model = new NewEnvironmentModel + { + Name = EnvironmentName, + AppProjectId = AppProject, + ServicePlan = ServicePlan, + Cluster = ClusterName, + DbProvider = DbProvider, + DbName = DbName + }; + + var cloudClient = CreateVirtocloudClient(CloudUrl, await GetCloudTokenAsync()); + await cloudClient.EnvironmentsCreateAsync(model); + }); + + public Target CloudUp => _ => _ + .DependsOn(CloudInit, CloudDeploy); + + private static ISaaSDeploymentApi CreateVirtocloudClient(string url, string token) + { + var config = new VirtoCloud.Client.Client.Configuration(); + config.BasePath = url; + config.AccessToken = token; + config.DefaultHeaders.Add("api_key", token); + return new SaaSDeploymentApi(config); + } } diff --git a/src/VirtoCommerce.Build/VirtoCommerce.Build.csproj b/src/VirtoCommerce.Build/VirtoCommerce.Build.csproj index a127b68..9f5435c 100644 --- a/src/VirtoCommerce.Build/VirtoCommerce.Build.csproj +++ b/src/VirtoCommerce.Build/VirtoCommerce.Build.csproj @@ -95,4 +95,8 @@ <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> </ItemGroup> + + <ItemGroup> + <ProjectReference Include="..\Virtocloud.Client\src\VirtoCloud.Client\VirtoCloud.Client.csproj" /> + </ItemGroup> </Project> \ No newline at end of file diff --git a/src/Virtocloud.Client/.gitignore b/src/Virtocloud.Client/.gitignore new file mode 100644 index 0000000..1ee5385 --- /dev/null +++ b/src/Virtocloud.Client/.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/src/Virtocloud.Client/.openapi-generator-ignore b/src/Virtocloud.Client/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/src/Virtocloud.Client/.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/src/Virtocloud.Client/.openapi-generator/FILES b/src/Virtocloud.Client/.openapi-generator/FILES new file mode 100644 index 0000000..1b3976a --- /dev/null +++ b/src/Virtocloud.Client/.openapi-generator/FILES @@ -0,0 +1,45 @@ +.gitignore +.openapi-generator-ignore +README.md +VirtoCloud.Client.sln +api/openapi.yaml +appveyor.yml +docs/CloudEnvironment.md +docs/EnvironmentNameValidationRequest.md +docs/Helm.md +docs/HelmObject.md +docs/NewEnvironmentModel.md +docs/SaaSDeploymentApi.md +git_push.sh +src/VirtoCloud.Client.Test/Api/SaaSDeploymentApiTests.cs +src/VirtoCloud.Client.Test/Model/CloudEnvironmentTests.cs +src/VirtoCloud.Client.Test/Model/EnvironmentNameValidationRequestTests.cs +src/VirtoCloud.Client.Test/Model/HelmObjectTests.cs +src/VirtoCloud.Client.Test/Model/HelmTests.cs +src/VirtoCloud.Client.Test/Model/NewEnvironmentModelTests.cs +src/VirtoCloud.Client.Test/VirtoCloud.Client.Test.csproj +src/VirtoCloud.Client/Api/SaaSDeploymentApi.cs +src/VirtoCloud.Client/Client/ApiClient.cs +src/VirtoCloud.Client/Client/ApiException.cs +src/VirtoCloud.Client/Client/ApiResponse.cs +src/VirtoCloud.Client/Client/ClientUtils.cs +src/VirtoCloud.Client/Client/Configuration.cs +src/VirtoCloud.Client/Client/ExceptionFactory.cs +src/VirtoCloud.Client/Client/FileParameter.cs +src/VirtoCloud.Client/Client/GlobalConfiguration.cs +src/VirtoCloud.Client/Client/IApiAccessor.cs +src/VirtoCloud.Client/Client/IAsynchronousClient.cs +src/VirtoCloud.Client/Client/IReadableConfiguration.cs +src/VirtoCloud.Client/Client/ISynchronousClient.cs +src/VirtoCloud.Client/Client/Multimap.cs +src/VirtoCloud.Client/Client/OpenAPIDateConverter.cs +src/VirtoCloud.Client/Client/RequestOptions.cs +src/VirtoCloud.Client/Client/RetryConfiguration.cs +src/VirtoCloud.Client/Client/WebRequestPathBuilder.cs +src/VirtoCloud.Client/Model/AbstractOpenAPISchema.cs +src/VirtoCloud.Client/Model/CloudEnvironment.cs +src/VirtoCloud.Client/Model/EnvironmentNameValidationRequest.cs +src/VirtoCloud.Client/Model/Helm.cs +src/VirtoCloud.Client/Model/HelmObject.cs +src/VirtoCloud.Client/Model/NewEnvironmentModel.cs +src/VirtoCloud.Client/VirtoCloud.Client.csproj diff --git a/src/Virtocloud.Client/.openapi-generator/VERSION b/src/Virtocloud.Client/.openapi-generator/VERSION new file mode 100644 index 0000000..3769235 --- /dev/null +++ b/src/Virtocloud.Client/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/src/Virtocloud.Client/README.md b/src/Virtocloud.Client/README.md new file mode 100644 index 0000000..3d05fce --- /dev/null +++ b/src/Virtocloud.Client/README.md @@ -0,0 +1,199 @@ +# VirtoCloud.Client - the C# library for the VirtoCommerce.SaaS + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: v1 +- SDK version: 1.0.0 +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +<a id="frameworks-supported"></a> +## Frameworks supported + +<a id="dependencies"></a> +## Dependencies + +- [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 Newtonsoft.Json +Install-Package JsonSubTypes +Install-Package System.ComponentModel.Annotations +``` +<a id="installation"></a> +## 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 VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; +``` +<a id="packaging"></a> +## 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 VirtoCloud.Client.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. + +<a id="usage"></a> +## 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; +``` + +### Connections +Each ApiClass (properly the ApiClient inside it) will create an instance of HttpClient. It will use that for the entire lifecycle and dispose it when called the Dispose method. + +To better manager the connections it's a common practice to reuse the HttpClient and HttpClientHandler (see [here](https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net) for details). To use your own HttpClient instance just pass it to the ApiClass constructor. + +```csharp +HttpClientHandler yourHandler = new HttpClientHandler(); +HttpClient yourHttpClient = new HttpClient(yourHandler); +var api = new YourApiClass(yourHttpClient, yourHandler); +``` + +If you want to use an HttpClient and don't have access to the handler, for example in a DI context in Asp.net Core when using IHttpClientFactory. + +```csharp +HttpClient yourHttpClient = new HttpClient(); +var api = new YourApiClass(yourHttpClient); +``` +You'll loose some configuration settings, the features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. You need to either manually handle those in your setup of the HttpClient or they won't be available. + +Here an example of DI setup in a sample web project: + +```csharp +services.AddHttpClient<YourApiClass>(httpClient => + new PetApi(httpClient)); +``` + + +<a id="getting-started"></a> +## Getting Started + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class Example + { + public static void Main() + { + + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var body = null; // Object? | (optional) + + try + { + apiInstance.AppProjectsCreate(body); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.AppProjectsCreate: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + + } + } +} +``` + +<a id="documentation-for-api-endpoints"></a> +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*SaaSDeploymentApi* | [**AppProjectsCreate**](docs/SaaSDeploymentApi.md#appprojectscreate) | **POST** /api/saas/app-projects/create | +*SaaSDeploymentApi* | [**AppProjectsDelete**](docs/SaaSDeploymentApi.md#appprojectsdelete) | **POST** /api/saas/app-projects/delete | +*SaaSDeploymentApi* | [**AppProjectsGetOrganizationsList**](docs/SaaSDeploymentApi.md#appprojectsgetorganizationslist) | **GET** /api/saas/app-projects/org-list | +*SaaSDeploymentApi* | [**AppProjectsList**](docs/SaaSDeploymentApi.md#appprojectslist) | **GET** /api/saas/app-projects/list | +*SaaSDeploymentApi* | [**AppProjectsUpdate**](docs/SaaSDeploymentApi.md#appprojectsupdate) | **PUT** /api/saas/app-projects/update | +*SaaSDeploymentApi* | [**AppsKibana**](docs/SaaSDeploymentApi.md#appskibana) | **GET** /apps/kibana | +*SaaSDeploymentApi* | [**CacheClear**](docs/SaaSDeploymentApi.md#cacheclear) | **GET** /api/saas/cache/clear | +*SaaSDeploymentApi* | [**DocsGetContent**](docs/SaaSDeploymentApi.md#docsgetcontent) | **GET** /api/saas/Docs/content/{path} | +*SaaSDeploymentApi* | [**DocsGetMenu**](docs/SaaSDeploymentApi.md#docsgetmenu) | **GET** /api/saas/Docs/menu | +*SaaSDeploymentApi* | [**EnvironmentsCanCreate**](docs/SaaSDeploymentApi.md#environmentscancreate) | **GET** /api/saas/environments/can-create/{appProject} | +*SaaSDeploymentApi* | [**EnvironmentsCanSave**](docs/SaaSDeploymentApi.md#environmentscansave) | **POST** /api/saas/environments/can-save | +*SaaSDeploymentApi* | [**EnvironmentsCreate**](docs/SaaSDeploymentApi.md#environmentscreate) | **POST** /api/saas/environments | +*SaaSDeploymentApi* | [**EnvironmentsDelete**](docs/SaaSDeploymentApi.md#environmentsdelete) | **DELETE** /api/saas/environments | +*SaaSDeploymentApi* | [**EnvironmentsDownloadManifest**](docs/SaaSDeploymentApi.md#environmentsdownloadmanifest) | **GET** /api/saas/environments/manifest/{appProject}/{appName} | +*SaaSDeploymentApi* | [**EnvironmentsGetClusters**](docs/SaaSDeploymentApi.md#environmentsgetclusters) | **GET** /api/saas/environments/clusters | +*SaaSDeploymentApi* | [**EnvironmentsGetEnvironment**](docs/SaaSDeploymentApi.md#environmentsgetenvironment) | **GET** /api/saas/environments/{envName} | +*SaaSDeploymentApi* | [**EnvironmentsGetEnvironment_0**](docs/SaaSDeploymentApi.md#environmentsgetenvironment_0) | **GET** /api/saas/environments/{organizationName}/{envName} | +*SaaSDeploymentApi* | [**EnvironmentsGetImageTags**](docs/SaaSDeploymentApi.md#environmentsgetimagetags) | **GET** /api/saas/environments/tags | +*SaaSDeploymentApi* | [**EnvironmentsGetImages**](docs/SaaSDeploymentApi.md#environmentsgetimages) | **GET** /api/saas/environments/images/{appProjectName} | +*SaaSDeploymentApi* | [**EnvironmentsGetLimits**](docs/SaaSDeploymentApi.md#environmentsgetlimits) | **GET** /api/saas/environments/limits | +*SaaSDeploymentApi* | [**EnvironmentsGetServicePlan**](docs/SaaSDeploymentApi.md#environmentsgetserviceplan) | **GET** /api/saas/environments/service-plan/{name} | +*SaaSDeploymentApi* | [**EnvironmentsGetSummary**](docs/SaaSDeploymentApi.md#environmentsgetsummary) | **GET** /api/saas/environments/summary | +*SaaSDeploymentApi* | [**EnvironmentsGetTier**](docs/SaaSDeploymentApi.md#environmentsgettier) | **GET** /api/saas/environments/tier | +*SaaSDeploymentApi* | [**EnvironmentsList**](docs/SaaSDeploymentApi.md#environmentslist) | **GET** /api/saas/environments | +*SaaSDeploymentApi* | [**EnvironmentsUpdate**](docs/SaaSDeploymentApi.md#environmentsupdate) | **PUT** /api/saas/environments | +*SaaSDeploymentApi* | [**EnvironmentsUpdate_0**](docs/SaaSDeploymentApi.md#environmentsupdate_0) | **PUT** /api/saas/environments/update | +*SaaSDeploymentApi* | [**EnvironmentsValidateName**](docs/SaaSDeploymentApi.md#environmentsvalidatename) | **POST** /api/saas/environments/validate-name | +*SaaSDeploymentApi* | [**MetricsGetMetrics**](docs/SaaSDeploymentApi.md#metricsgetmetrics) | **POST** /api/saas/metrics | +*SaaSDeploymentApi* | [**RssGetNews**](docs/SaaSDeploymentApi.md#rssgetnews) | **GET** /api/saas/Rss/news | +*SaaSDeploymentApi* | [**SystemVersion**](docs/SaaSDeploymentApi.md#systemversion) | **POST** /api/saas/system/version | +*SaaSDeploymentApi* | [**TemplatesGetClusters**](docs/SaaSDeploymentApi.md#templatesgetclusters) | **GET** /api/saas/templates/clusters | +*SaaSDeploymentApi* | [**TemplatesGetServicePlan**](docs/SaaSDeploymentApi.md#templatesgetserviceplan) | **GET** /api/saas/templates/service-plan/{name} | +*SaaSDeploymentApi* | [**TemplatesGetServicePlans**](docs/SaaSDeploymentApi.md#templatesgetserviceplans) | **GET** /api/saas/templates/service-plans | + + +<a id="documentation-for-models"></a> +## Documentation for Models + + - [Model.CloudEnvironment](docs/CloudEnvironment.md) + - [Model.EnvironmentNameValidationRequest](docs/EnvironmentNameValidationRequest.md) + - [Model.Helm](docs/Helm.md) + - [Model.HelmObject](docs/HelmObject.md) + - [Model.NewEnvironmentModel](docs/NewEnvironmentModel.md) + + +<a id="documentation-for-authorization"></a> +## Documentation for Authorization + + +Authentication schemes defined for the API: +<a id="oauth2"></a> +### oauth2 + +- **Type**: OAuth +- **Flow**: password +- **Authorization URL**: +- **Scopes**: N/A + diff --git a/src/Virtocloud.Client/VirtoCloud.Client.sln b/src/Virtocloud.Client/VirtoCloud.Client.sln new file mode 100644 index 0000000..1d4a15e --- /dev/null +++ b/src/Virtocloud.Client/VirtoCloud.Client.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VirtoCloud.Client", "src\VirtoCloud.Client\VirtoCloud.Client.csproj", "{67C9DFC3-35DF-4CB5-A36E-92D1C3F7295D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VirtoCloud.Client.Test", "src\VirtoCloud.Client.Test\VirtoCloud.Client.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {67C9DFC3-35DF-4CB5-A36E-92D1C3F7295D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {67C9DFC3-35DF-4CB5-A36E-92D1C3F7295D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {67C9DFC3-35DF-4CB5-A36E-92D1C3F7295D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {67C9DFC3-35DF-4CB5-A36E-92D1C3F7295D}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/src/Virtocloud.Client/api/openapi.yaml b/src/Virtocloud.Client/api/openapi.yaml new file mode 100644 index 0000000..acf03a7 --- /dev/null +++ b/src/Virtocloud.Client/api/openapi.yaml @@ -0,0 +1,872 @@ +openapi: 3.0.1 +info: + title: VirtoCommerce.SaaS + version: v1 +servers: +- url: / +paths: + /api/saas/app-projects/create: + post: + operationId: AppProjects_Create + requestBody: + content: + application/json-patch+json: + schema: {} + application/json: + schema: {} + text/json: + schema: {} + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:config + tags: + - SaaS Deployment + /api/saas/app-projects/update: + put: + operationId: AppProjects_Update + requestBody: + content: + application/json-patch+json: + schema: {} + application/json: + schema: {} + text/json: + schema: {} + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:config + tags: + - SaaS Deployment + /api/saas/app-projects/list: + get: + operationId: AppProjects_List + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/app-projects/delete: + post: + operationId: AppProjects_Delete + requestBody: + content: + application/json-patch+json: + schema: {} + application/json: + schema: {} + text/json: + schema: {} + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:config + tags: + - SaaS Deployment + /api/saas/app-projects/org-list: + get: + operationId: AppProjects_GetOrganizationsList + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:config + tags: + - SaaS Deployment + /apps/kibana: + get: + operationId: Apps_Kibana + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/cache/clear: + get: + operationId: Cache_Clear + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:config + tags: + - SaaS Deployment + /api/saas/Docs/menu: + get: + operationId: Docs_GetMenu + responses: + "200": + description: Success + tags: + - SaaS Deployment + /api/saas/Docs/content/{path}: + get: + operationId: Docs_GetContent + parameters: + - explode: false + in: path + name: path + required: true + schema: + type: string + style: simple + responses: + "200": + description: Success + tags: + - SaaS Deployment + /api/saas/environments: + delete: + operationId: Environments_Delete + parameters: + - explode: true + in: query + name: complexIds + required: false + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: appProjectId + required: false + schema: + type: string + style: form + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:delete + tags: + - SaaS Deployment + get: + operationId: Environments_List + responses: + "200": + content: + text/plain: + schema: + items: + $ref: '#/components/schemas/CloudEnvironment' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/CloudEnvironment' + type: array + text/json: + schema: + items: + $ref: '#/components/schemas/CloudEnvironment' + type: array + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + post: + operationId: Environments_Create + requestBody: + content: + application/json-patch+json: + schema: + allOf: + - $ref: '#/components/schemas/NewEnvironmentModel' + application/json: + schema: + allOf: + - $ref: '#/components/schemas/NewEnvironmentModel' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/NewEnvironmentModel' + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:create + tags: + - SaaS Deployment + put: + operationId: Environments_Update + requestBody: + content: + application/json-patch+json: + schema: + allOf: + - $ref: '#/components/schemas/CloudEnvironment' + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CloudEnvironment' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/CloudEnvironment' + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:update + tags: + - SaaS Deployment + /api/saas/environments/{envName}: + get: + operationId: Environments_GetEnvironment + parameters: + - explode: false + in: path + name: envName + required: true + schema: + type: string + style: simple + responses: + "200": + content: + text/plain: + schema: + items: + $ref: '#/components/schemas/CloudEnvironment' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/CloudEnvironment' + type: array + text/json: + schema: + items: + $ref: '#/components/schemas/CloudEnvironment' + type: array + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/environments/{organizationName}/{envName}: + get: + operationId: Environments_GetEnvironment + parameters: + - explode: false + in: path + name: organizationName + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: envName + required: true + schema: + type: string + style: simple + responses: + "200": + content: + text/plain: + schema: + items: + $ref: '#/components/schemas/CloudEnvironment' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/CloudEnvironment' + type: array + text/json: + schema: + items: + $ref: '#/components/schemas/CloudEnvironment' + type: array + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/environments/can-create/{appProject}: + get: + operationId: Environments_CanCreate + parameters: + - explode: false + in: path + name: appProject + required: true + schema: + type: string + style: simple + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/environments/limits: + get: + operationId: Environments_GetLimits + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/environments/can-save: + post: + operationId: Environments_CanSave + requestBody: + content: + application/json-patch+json: + schema: + allOf: + - $ref: '#/components/schemas/CloudEnvironment' + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CloudEnvironment' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/CloudEnvironment' + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:update + tags: + - SaaS Deployment + /api/saas/environments/tier: + get: + operationId: Environments_GetTier + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/environments/summary: + get: + operationId: Environments_GetSummary + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/environments/manifest/{appProject}/{appName}: + get: + operationId: Environments_DownloadManifest + parameters: + - explode: false + in: path + name: appProject + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: appName + required: true + schema: + type: string + style: simple + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/environments/images/{appProjectName}: + get: + operationId: Environments_GetImages + parameters: + - explode: false + in: path + name: appProjectName + required: true + schema: + type: string + style: simple + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/environments/tags: + get: + operationId: Environments_GetImageTags + parameters: + - explode: true + in: query + name: imageName + required: false + schema: + type: string + style: form + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/environments/update: + put: + operationId: Environments_Update + requestBody: + content: + multipart/form-data: + encoding: + manifest: + style: form + appProject: + style: form + schema: + $ref: '#/components/schemas/Environments_Update_request' + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:update + tags: + - SaaS Deployment + /api/saas/environments/service-plan/{name}: + get: + operationId: Environments_GetServicePlan + parameters: + - explode: false + in: path + name: name + required: true + schema: + type: string + style: simple + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/environments/validate-name: + post: + operationId: Environments_ValidateName + requestBody: + content: + application/json-patch+json: + schema: + allOf: + - $ref: '#/components/schemas/EnvironmentNameValidationRequest' + application/json: + schema: + allOf: + - $ref: '#/components/schemas/EnvironmentNameValidationRequest' + text/json: + schema: + allOf: + - $ref: '#/components/schemas/EnvironmentNameValidationRequest' + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/environments/clusters: + get: + operationId: Environments_GetClusters + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/metrics: + post: + operationId: Metrics_GetMetrics + requestBody: + content: + application/json-patch+json: + schema: {} + application/json: + schema: {} + text/json: + schema: {} + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/Rss/news: + get: + operationId: Rss_GetNews + responses: + "200": + description: Success + tags: + - SaaS Deployment + /api/saas/system/version: + post: + operationId: System_Version + requestBody: + content: + application/json-patch+json: + schema: {} + application/json: + schema: {} + text/json: + schema: {} + responses: + "200": + description: Success + tags: + - SaaS Deployment + /api/saas/templates/service-plan/{name}: + get: + operationId: Templates_GetServicePlan + parameters: + - explode: false + in: path + name: name + required: true + schema: + type: string + style: simple + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/templates/service-plans: + get: + operationId: Templates_GetServicePlans + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment + /api/saas/templates/clusters: + get: + operationId: Templates_GetClusters + responses: + "200": + description: Success + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - oauth2: + - saas:env:read + tags: + - SaaS Deployment +components: + schemas: + CloudEnvironment: + additionalProperties: false + example: + urls: + - urls + - urls + created: 2000-01-23T04:56:07.000+00:00 + appProjectId: appProjectId + tenantId: tenantId + name: name + metadataName: metadataName + id: id + updated: 2000-01-23T04:56:07.000+00:00 + syncStatus: syncStatus + helm: "" + labels: + key: labels + status: status + properties: + labels: + additionalProperties: + type: string + nullable: true + type: object + appProjectId: + nullable: true + type: string + metadataName: + nullable: true + type: string + tenantId: + nullable: true + type: string + id: + nullable: true + type: string + name: + nullable: true + type: string + status: + nullable: true + type: string + syncStatus: + nullable: true + type: string + created: + format: date-time + type: string + updated: + format: date-time + type: string + urls: + items: + type: string + nullable: true + type: array + helm: + allOf: + - $ref: '#/components/schemas/Helm' + nullable: true + type: object + EnvironmentNameValidationRequest: + additionalProperties: false + example: + appProject: appProject + name: name + properties: + appProject: + nullable: true + type: string + name: + nullable: true + type: string + type: object + Helm: + additionalProperties: false + properties: + parameters: + additionalProperties: + type: string + nullable: true + type: object + type: object + HelmObject: + additionalProperties: false + properties: + parameters: + additionalProperties: + type: string + nullable: true + type: object + type: object + NewEnvironmentModel: + additionalProperties: false + example: + cluster: cluster + servicePlan: servicePlan + dbName: dbName + name: name + appProjectId: appProjectId + dbProvider: dbProvider + helm: "" + properties: + name: + nullable: true + type: string + dbName: + nullable: true + type: string + appProjectId: + nullable: true + type: string + cluster: + nullable: true + type: string + servicePlan: + nullable: true + type: string + dbProvider: + nullable: true + type: string + helm: + allOf: + - $ref: '#/components/schemas/HelmObject' + nullable: true + type: object + Environments_Update_request: + properties: + manifest: + type: string + appProject: + type: string + type: object + securitySchemes: + oauth2: + description: OAuth2 Resource Owner Password Grant flow + flows: + password: + scopes: {} + tokenUrl: /connect/token + type: oauth2 + diff --git a/src/Virtocloud.Client/appveyor.yml b/src/Virtocloud.Client/appveyor.yml new file mode 100644 index 0000000..910d676 --- /dev/null +++ b/src/Virtocloud.Client/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\VirtoCloud.Client\VirtoCloud.Client.csproj -o ../../output -c Release --no-build diff --git a/src/Virtocloud.Client/docs/CloudEnvironment.md b/src/Virtocloud.Client/docs/CloudEnvironment.md new file mode 100644 index 0000000..2972541 --- /dev/null +++ b/src/Virtocloud.Client/docs/CloudEnvironment.md @@ -0,0 +1,21 @@ +# VirtoCloud.Client.Model.CloudEnvironment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Labels** | **Dictionary<string, string>** | | [optional] +**AppProjectId** | **string** | | [optional] +**MetadataName** | **string** | | [optional] +**TenantId** | **string** | | [optional] +**Id** | **string** | | [optional] +**Name** | **string** | | [optional] +**Status** | **string** | | [optional] +**SyncStatus** | **string** | | [optional] +**Created** | **DateTime** | | [optional] +**Updated** | **DateTime** | | [optional] +**Urls** | **List<string>** | | [optional] +**Helm** | [**Helm**](Helm.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/src/Virtocloud.Client/docs/EnvironmentNameValidationRequest.md b/src/Virtocloud.Client/docs/EnvironmentNameValidationRequest.md new file mode 100644 index 0000000..cea1e85 --- /dev/null +++ b/src/Virtocloud.Client/docs/EnvironmentNameValidationRequest.md @@ -0,0 +1,11 @@ +# VirtoCloud.Client.Model.EnvironmentNameValidationRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppProject** | **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/src/Virtocloud.Client/docs/Helm.md b/src/Virtocloud.Client/docs/Helm.md new file mode 100644 index 0000000..f3eb811 --- /dev/null +++ b/src/Virtocloud.Client/docs/Helm.md @@ -0,0 +1,10 @@ +# VirtoCloud.Client.Model.Helm + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Parameters** | **Dictionary<string, 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/src/Virtocloud.Client/docs/HelmObject.md b/src/Virtocloud.Client/docs/HelmObject.md new file mode 100644 index 0000000..7fbfa46 --- /dev/null +++ b/src/Virtocloud.Client/docs/HelmObject.md @@ -0,0 +1,10 @@ +# VirtoCloud.Client.Model.HelmObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Parameters** | **Dictionary<string, 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/src/Virtocloud.Client/docs/NewEnvironmentModel.md b/src/Virtocloud.Client/docs/NewEnvironmentModel.md new file mode 100644 index 0000000..d19cd46 --- /dev/null +++ b/src/Virtocloud.Client/docs/NewEnvironmentModel.md @@ -0,0 +1,16 @@ +# VirtoCloud.Client.Model.NewEnvironmentModel + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] +**DbName** | **string** | | [optional] +**AppProjectId** | **string** | | [optional] +**Cluster** | **string** | | [optional] +**ServicePlan** | **string** | | [optional] +**DbProvider** | **string** | | [optional] +**Helm** | [**HelmObject**](HelmObject.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/src/Virtocloud.Client/docs/SaaSDeploymentApi.md b/src/Virtocloud.Client/docs/SaaSDeploymentApi.md new file mode 100644 index 0000000..ff0ee46 --- /dev/null +++ b/src/Virtocloud.Client/docs/SaaSDeploymentApi.md @@ -0,0 +1,3011 @@ +# VirtoCloud.Client.Api.SaaSDeploymentApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**AppProjectsCreate**](SaaSDeploymentApi.md#appprojectscreate) | **POST** /api/saas/app-projects/create | | +| [**AppProjectsDelete**](SaaSDeploymentApi.md#appprojectsdelete) | **POST** /api/saas/app-projects/delete | | +| [**AppProjectsGetOrganizationsList**](SaaSDeploymentApi.md#appprojectsgetorganizationslist) | **GET** /api/saas/app-projects/org-list | | +| [**AppProjectsList**](SaaSDeploymentApi.md#appprojectslist) | **GET** /api/saas/app-projects/list | | +| [**AppProjectsUpdate**](SaaSDeploymentApi.md#appprojectsupdate) | **PUT** /api/saas/app-projects/update | | +| [**AppsKibana**](SaaSDeploymentApi.md#appskibana) | **GET** /apps/kibana | | +| [**CacheClear**](SaaSDeploymentApi.md#cacheclear) | **GET** /api/saas/cache/clear | | +| [**DocsGetContent**](SaaSDeploymentApi.md#docsgetcontent) | **GET** /api/saas/Docs/content/{path} | | +| [**DocsGetMenu**](SaaSDeploymentApi.md#docsgetmenu) | **GET** /api/saas/Docs/menu | | +| [**EnvironmentsCanCreate**](SaaSDeploymentApi.md#environmentscancreate) | **GET** /api/saas/environments/can-create/{appProject} | | +| [**EnvironmentsCanSave**](SaaSDeploymentApi.md#environmentscansave) | **POST** /api/saas/environments/can-save | | +| [**EnvironmentsCreate**](SaaSDeploymentApi.md#environmentscreate) | **POST** /api/saas/environments | | +| [**EnvironmentsDelete**](SaaSDeploymentApi.md#environmentsdelete) | **DELETE** /api/saas/environments | | +| [**EnvironmentsDownloadManifest**](SaaSDeploymentApi.md#environmentsdownloadmanifest) | **GET** /api/saas/environments/manifest/{appProject}/{appName} | | +| [**EnvironmentsGetClusters**](SaaSDeploymentApi.md#environmentsgetclusters) | **GET** /api/saas/environments/clusters | | +| [**EnvironmentsGetEnvironment**](SaaSDeploymentApi.md#environmentsgetenvironment) | **GET** /api/saas/environments/{envName} | | +| [**EnvironmentsGetEnvironment_0**](SaaSDeploymentApi.md#environmentsgetenvironment_0) | **GET** /api/saas/environments/{organizationName}/{envName} | | +| [**EnvironmentsGetImageTags**](SaaSDeploymentApi.md#environmentsgetimagetags) | **GET** /api/saas/environments/tags | | +| [**EnvironmentsGetImages**](SaaSDeploymentApi.md#environmentsgetimages) | **GET** /api/saas/environments/images/{appProjectName} | | +| [**EnvironmentsGetLimits**](SaaSDeploymentApi.md#environmentsgetlimits) | **GET** /api/saas/environments/limits | | +| [**EnvironmentsGetServicePlan**](SaaSDeploymentApi.md#environmentsgetserviceplan) | **GET** /api/saas/environments/service-plan/{name} | | +| [**EnvironmentsGetSummary**](SaaSDeploymentApi.md#environmentsgetsummary) | **GET** /api/saas/environments/summary | | +| [**EnvironmentsGetTier**](SaaSDeploymentApi.md#environmentsgettier) | **GET** /api/saas/environments/tier | | +| [**EnvironmentsList**](SaaSDeploymentApi.md#environmentslist) | **GET** /api/saas/environments | | +| [**EnvironmentsUpdate**](SaaSDeploymentApi.md#environmentsupdate) | **PUT** /api/saas/environments | | +| [**EnvironmentsUpdate_0**](SaaSDeploymentApi.md#environmentsupdate_0) | **PUT** /api/saas/environments/update | | +| [**EnvironmentsValidateName**](SaaSDeploymentApi.md#environmentsvalidatename) | **POST** /api/saas/environments/validate-name | | +| [**MetricsGetMetrics**](SaaSDeploymentApi.md#metricsgetmetrics) | **POST** /api/saas/metrics | | +| [**RssGetNews**](SaaSDeploymentApi.md#rssgetnews) | **GET** /api/saas/Rss/news | | +| [**SystemVersion**](SaaSDeploymentApi.md#systemversion) | **POST** /api/saas/system/version | | +| [**TemplatesGetClusters**](SaaSDeploymentApi.md#templatesgetclusters) | **GET** /api/saas/templates/clusters | | +| [**TemplatesGetServicePlan**](SaaSDeploymentApi.md#templatesgetserviceplan) | **GET** /api/saas/templates/service-plan/{name} | | +| [**TemplatesGetServicePlans**](SaaSDeploymentApi.md#templatesgetserviceplans) | **GET** /api/saas/templates/service-plans | | + +<a id="appprojectscreate"></a> +# **AppProjectsCreate** +> void AppProjectsCreate (Object? body = null) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class AppProjectsCreateExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var body = null; // Object? | (optional) + + try + { + apiInstance.AppProjectsCreate(body); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.AppProjectsCreate: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AppProjectsCreateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.AppProjectsCreateWithHttpInfo(body); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.AppProjectsCreateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **Object?** | | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/json, text/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="appprojectsdelete"></a> +# **AppProjectsDelete** +> void AppProjectsDelete (Object? body = null) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class AppProjectsDeleteExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var body = null; // Object? | (optional) + + try + { + apiInstance.AppProjectsDelete(body); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.AppProjectsDelete: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AppProjectsDeleteWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.AppProjectsDeleteWithHttpInfo(body); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.AppProjectsDeleteWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **Object?** | | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/json, text/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="appprojectsgetorganizationslist"></a> +# **AppProjectsGetOrganizationsList** +> void AppProjectsGetOrganizationsList () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class AppProjectsGetOrganizationsListExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + + try + { + apiInstance.AppProjectsGetOrganizationsList(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.AppProjectsGetOrganizationsList: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AppProjectsGetOrganizationsListWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.AppProjectsGetOrganizationsListWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.AppProjectsGetOrganizationsListWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="appprojectslist"></a> +# **AppProjectsList** +> void AppProjectsList () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class AppProjectsListExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + + try + { + apiInstance.AppProjectsList(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.AppProjectsList: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AppProjectsListWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.AppProjectsListWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.AppProjectsListWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="appprojectsupdate"></a> +# **AppProjectsUpdate** +> void AppProjectsUpdate (Object? body = null) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class AppProjectsUpdateExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var body = null; // Object? | (optional) + + try + { + apiInstance.AppProjectsUpdate(body); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.AppProjectsUpdate: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AppProjectsUpdateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.AppProjectsUpdateWithHttpInfo(body); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.AppProjectsUpdateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **Object?** | | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/json, text/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="appskibana"></a> +# **AppsKibana** +> void AppsKibana () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class AppsKibanaExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + + try + { + apiInstance.AppsKibana(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.AppsKibana: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AppsKibanaWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.AppsKibanaWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.AppsKibanaWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="cacheclear"></a> +# **CacheClear** +> void CacheClear () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class CacheClearExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + + try + { + apiInstance.CacheClear(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.CacheClear: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CacheClearWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.CacheClearWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.CacheClearWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="docsgetcontent"></a> +# **DocsGetContent** +> void DocsGetContent (string path) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class DocsGetContentExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var path = "path_example"; // string | + + try + { + apiInstance.DocsGetContent(path); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.DocsGetContent: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DocsGetContentWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.DocsGetContentWithHttpInfo(path); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.DocsGetContentWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **path** | **string** | | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="docsgetmenu"></a> +# **DocsGetMenu** +> void DocsGetMenu () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class DocsGetMenuExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + + try + { + apiInstance.DocsGetMenu(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.DocsGetMenu: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DocsGetMenuWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.DocsGetMenuWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.DocsGetMenuWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentscancreate"></a> +# **EnvironmentsCanCreate** +> void EnvironmentsCanCreate (string appProject) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsCanCreateExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var appProject = "appProject_example"; // string | + + try + { + apiInstance.EnvironmentsCanCreate(appProject); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsCanCreate: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsCanCreateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsCanCreateWithHttpInfo(appProject); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsCanCreateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **appProject** | **string** | | | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentscansave"></a> +# **EnvironmentsCanSave** +> void EnvironmentsCanSave (CloudEnvironment? cloudEnvironment = null) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsCanSaveExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var cloudEnvironment = new CloudEnvironment?(); // CloudEnvironment? | (optional) + + try + { + apiInstance.EnvironmentsCanSave(cloudEnvironment); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsCanSave: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsCanSaveWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsCanSaveWithHttpInfo(cloudEnvironment); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsCanSaveWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **cloudEnvironment** | [**CloudEnvironment?**](CloudEnvironment?.md) | | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/json, text/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentscreate"></a> +# **EnvironmentsCreate** +> void EnvironmentsCreate (NewEnvironmentModel? newEnvironmentModel = null) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsCreateExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var newEnvironmentModel = new NewEnvironmentModel?(); // NewEnvironmentModel? | (optional) + + try + { + apiInstance.EnvironmentsCreate(newEnvironmentModel); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsCreate: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsCreateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsCreateWithHttpInfo(newEnvironmentModel); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsCreateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **newEnvironmentModel** | [**NewEnvironmentModel?**](NewEnvironmentModel?.md) | | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/json, text/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentsdelete"></a> +# **EnvironmentsDelete** +> void EnvironmentsDelete (List<string>? complexIds = null, string? appProjectId = null) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsDeleteExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var complexIds = new List<string>?(); // List<string>? | (optional) + var appProjectId = "appProjectId_example"; // string? | (optional) + + try + { + apiInstance.EnvironmentsDelete(complexIds, appProjectId); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsDelete: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsDeleteWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsDeleteWithHttpInfo(complexIds, appProjectId); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsDeleteWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **complexIds** | [**List<string>?**](string.md) | | [optional] | +| **appProjectId** | **string?** | | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentsdownloadmanifest"></a> +# **EnvironmentsDownloadManifest** +> void EnvironmentsDownloadManifest (string appProject, string appName) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsDownloadManifestExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var appProject = "appProject_example"; // string | + var appName = "appName_example"; // string | + + try + { + apiInstance.EnvironmentsDownloadManifest(appProject, appName); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsDownloadManifest: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsDownloadManifestWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsDownloadManifestWithHttpInfo(appProject, appName); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsDownloadManifestWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **appProject** | **string** | | | +| **appName** | **string** | | | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentsgetclusters"></a> +# **EnvironmentsGetClusters** +> void EnvironmentsGetClusters () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsGetClustersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + + try + { + apiInstance.EnvironmentsGetClusters(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetClusters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsGetClustersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsGetClustersWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetClustersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentsgetenvironment"></a> +# **EnvironmentsGetEnvironment** +> List<CloudEnvironment> EnvironmentsGetEnvironment (string envName) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsGetEnvironmentExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var envName = "envName_example"; // string | + + try + { + List<CloudEnvironment> result = apiInstance.EnvironmentsGetEnvironment(envName); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetEnvironment: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsGetEnvironmentWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse<List<CloudEnvironment>> response = apiInstance.EnvironmentsGetEnvironmentWithHttpInfo(envName); + 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 SaaSDeploymentApi.EnvironmentsGetEnvironmentWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **envName** | **string** | | | + +### Return type + +[**List<CloudEnvironment>**](CloudEnvironment.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain, application/json, text/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentsgetenvironment_0"></a> +# **EnvironmentsGetEnvironment_0** +> List<CloudEnvironment> EnvironmentsGetEnvironment_0 (string organizationName, string envName) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsGetEnvironment_0Example + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var organizationName = "organizationName_example"; // string | + var envName = "envName_example"; // string | + + try + { + List<CloudEnvironment> result = apiInstance.EnvironmentsGetEnvironment_0(organizationName, envName); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetEnvironment_0: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsGetEnvironment_0WithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse<List<CloudEnvironment>> response = apiInstance.EnvironmentsGetEnvironment_0WithHttpInfo(organizationName, envName); + 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 SaaSDeploymentApi.EnvironmentsGetEnvironment_0WithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **organizationName** | **string** | | | +| **envName** | **string** | | | + +### Return type + +[**List<CloudEnvironment>**](CloudEnvironment.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain, application/json, text/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentsgetimagetags"></a> +# **EnvironmentsGetImageTags** +> void EnvironmentsGetImageTags (string? imageName = null) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsGetImageTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var imageName = "imageName_example"; // string? | (optional) + + try + { + apiInstance.EnvironmentsGetImageTags(imageName); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetImageTags: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsGetImageTagsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsGetImageTagsWithHttpInfo(imageName); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetImageTagsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **imageName** | **string?** | | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentsgetimages"></a> +# **EnvironmentsGetImages** +> void EnvironmentsGetImages (string appProjectName) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsGetImagesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var appProjectName = "appProjectName_example"; // string | + + try + { + apiInstance.EnvironmentsGetImages(appProjectName); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetImages: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsGetImagesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsGetImagesWithHttpInfo(appProjectName); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetImagesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **appProjectName** | **string** | | | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentsgetlimits"></a> +# **EnvironmentsGetLimits** +> void EnvironmentsGetLimits () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsGetLimitsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + + try + { + apiInstance.EnvironmentsGetLimits(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetLimits: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsGetLimitsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsGetLimitsWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetLimitsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentsgetserviceplan"></a> +# **EnvironmentsGetServicePlan** +> void EnvironmentsGetServicePlan (string name) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsGetServicePlanExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var name = "name_example"; // string | + + try + { + apiInstance.EnvironmentsGetServicePlan(name); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetServicePlan: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsGetServicePlanWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsGetServicePlanWithHttpInfo(name); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetServicePlanWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **name** | **string** | | | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentsgetsummary"></a> +# **EnvironmentsGetSummary** +> void EnvironmentsGetSummary () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsGetSummaryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + + try + { + apiInstance.EnvironmentsGetSummary(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetSummary: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsGetSummaryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsGetSummaryWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetSummaryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentsgettier"></a> +# **EnvironmentsGetTier** +> void EnvironmentsGetTier () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsGetTierExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + + try + { + apiInstance.EnvironmentsGetTier(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetTier: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsGetTierWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsGetTierWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsGetTierWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentslist"></a> +# **EnvironmentsList** +> List<CloudEnvironment> EnvironmentsList () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsListExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + + try + { + List<CloudEnvironment> result = apiInstance.EnvironmentsList(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsList: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsListWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse<List<CloudEnvironment>> response = apiInstance.EnvironmentsListWithHttpInfo(); + 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 SaaSDeploymentApi.EnvironmentsListWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**List<CloudEnvironment>**](CloudEnvironment.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain, application/json, text/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentsupdate"></a> +# **EnvironmentsUpdate** +> void EnvironmentsUpdate (CloudEnvironment? cloudEnvironment = null) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsUpdateExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var cloudEnvironment = new CloudEnvironment?(); // CloudEnvironment? | (optional) + + try + { + apiInstance.EnvironmentsUpdate(cloudEnvironment); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsUpdate: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsUpdateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsUpdateWithHttpInfo(cloudEnvironment); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsUpdateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **cloudEnvironment** | [**CloudEnvironment?**](CloudEnvironment?.md) | | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/json, text/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentsupdate_0"></a> +# **EnvironmentsUpdate_0** +> void EnvironmentsUpdate_0 (string? manifest = null, string? appProject = null) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsUpdate_0Example + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var manifest = "manifest_example"; // string? | (optional) + var appProject = "appProject_example"; // string? | (optional) + + try + { + apiInstance.EnvironmentsUpdate_0(manifest, appProject); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsUpdate_0: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsUpdate_0WithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsUpdate_0WithHttpInfo(manifest, appProject); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsUpdate_0WithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **manifest** | **string?** | | [optional] | +| **appProject** | **string?** | | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="environmentsvalidatename"></a> +# **EnvironmentsValidateName** +> void EnvironmentsValidateName (EnvironmentNameValidationRequest? environmentNameValidationRequest = null) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class EnvironmentsValidateNameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var environmentNameValidationRequest = new EnvironmentNameValidationRequest?(); // EnvironmentNameValidationRequest? | (optional) + + try + { + apiInstance.EnvironmentsValidateName(environmentNameValidationRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsValidateName: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the EnvironmentsValidateNameWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.EnvironmentsValidateNameWithHttpInfo(environmentNameValidationRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.EnvironmentsValidateNameWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **environmentNameValidationRequest** | [**EnvironmentNameValidationRequest?**](EnvironmentNameValidationRequest?.md) | | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/json, text/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="metricsgetmetrics"></a> +# **MetricsGetMetrics** +> void MetricsGetMetrics (Object? body = null) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class MetricsGetMetricsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var body = null; // Object? | (optional) + + try + { + apiInstance.MetricsGetMetrics(body); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.MetricsGetMetrics: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the MetricsGetMetricsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.MetricsGetMetricsWithHttpInfo(body); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.MetricsGetMetricsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **Object?** | | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/json, text/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="rssgetnews"></a> +# **RssGetNews** +> void RssGetNews () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class RssGetNewsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + + try + { + apiInstance.RssGetNews(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.RssGetNews: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RssGetNewsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.RssGetNewsWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.RssGetNewsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="systemversion"></a> +# **SystemVersion** +> void SystemVersion (Object? body = null) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class SystemVersionExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var body = null; // Object? | (optional) + + try + { + apiInstance.SystemVersion(body); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.SystemVersion: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the SystemVersionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.SystemVersionWithHttpInfo(body); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.SystemVersionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **Object?** | | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json-patch+json, application/json, text/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="templatesgetclusters"></a> +# **TemplatesGetClusters** +> void TemplatesGetClusters () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class TemplatesGetClustersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + + try + { + apiInstance.TemplatesGetClusters(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.TemplatesGetClusters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TemplatesGetClustersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TemplatesGetClustersWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.TemplatesGetClustersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="templatesgetserviceplan"></a> +# **TemplatesGetServicePlan** +> void TemplatesGetServicePlan (string name) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class TemplatesGetServicePlanExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + var name = "name_example"; // string | + + try + { + apiInstance.TemplatesGetServicePlan(name); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.TemplatesGetServicePlan: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TemplatesGetServicePlanWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TemplatesGetServicePlanWithHttpInfo(name); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.TemplatesGetServicePlanWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **name** | **string** | | | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +<a id="templatesgetserviceplans"></a> +# **TemplatesGetServicePlans** +> void TemplatesGetServicePlans () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using VirtoCloud.Client.Api; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace Example +{ + public class TemplatesGetServicePlansExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure OAuth2 access token for authorization: oauth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new SaaSDeploymentApi(httpClient, config, httpClientHandler); + + try + { + apiInstance.TemplatesGetServicePlans(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SaaSDeploymentApi.TemplatesGetServicePlans: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TemplatesGetServicePlansWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TemplatesGetServicePlansWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SaaSDeploymentApi.TemplatesGetServicePlansWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[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/src/Virtocloud.Client/git_push.sh b/src/Virtocloud.Client/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/src/Virtocloud.Client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Api/SaaSDeploymentApiTests.cs b/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Api/SaaSDeploymentApiTests.cs new file mode 100644 index 0000000..829f969 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Api/SaaSDeploymentApiTests.cs @@ -0,0 +1,413 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using Xunit; + +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Api; +// uncomment below to import models +//using VirtoCloud.Client.Model; + +namespace VirtoCloud.Client.Test.Api +{ + /// <summary> + /// Class for testing SaaSDeploymentApi + /// </summary> + /// <remarks> + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// </remarks> + public class SaaSDeploymentApiTests : IDisposable + { + private SaaSDeploymentApi instance; + + public SaaSDeploymentApiTests() + { + instance = new SaaSDeploymentApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// <summary> + /// Test an instance of SaaSDeploymentApi + /// </summary> + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' SaaSDeploymentApi + //Assert.IsType<SaaSDeploymentApi>(instance); + } + + /// <summary> + /// Test AppProjectsCreate + /// </summary> + [Fact] + public void AppProjectsCreateTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Object? body = null; + //instance.AppProjectsCreate(body); + } + + /// <summary> + /// Test AppProjectsDelete + /// </summary> + [Fact] + public void AppProjectsDeleteTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Object? body = null; + //instance.AppProjectsDelete(body); + } + + /// <summary> + /// Test AppProjectsGetOrganizationsList + /// </summary> + [Fact] + public void AppProjectsGetOrganizationsListTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.AppProjectsGetOrganizationsList(); + } + + /// <summary> + /// Test AppProjectsList + /// </summary> + [Fact] + public void AppProjectsListTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.AppProjectsList(); + } + + /// <summary> + /// Test AppProjectsUpdate + /// </summary> + [Fact] + public void AppProjectsUpdateTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Object? body = null; + //instance.AppProjectsUpdate(body); + } + + /// <summary> + /// Test AppsKibana + /// </summary> + [Fact] + public void AppsKibanaTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.AppsKibana(); + } + + /// <summary> + /// Test CacheClear + /// </summary> + [Fact] + public void CacheClearTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.CacheClear(); + } + + /// <summary> + /// Test DocsGetContent + /// </summary> + [Fact] + public void DocsGetContentTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string path = null; + //instance.DocsGetContent(path); + } + + /// <summary> + /// Test DocsGetMenu + /// </summary> + [Fact] + public void DocsGetMenuTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.DocsGetMenu(); + } + + /// <summary> + /// Test EnvironmentsCanCreate + /// </summary> + [Fact] + public void EnvironmentsCanCreateTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string appProject = null; + //instance.EnvironmentsCanCreate(appProject); + } + + /// <summary> + /// Test EnvironmentsCanSave + /// </summary> + [Fact] + public void EnvironmentsCanSaveTest() + { + // TODO uncomment below to test the method and replace null with proper value + //CloudEnvironment? cloudEnvironment = null; + //instance.EnvironmentsCanSave(cloudEnvironment); + } + + /// <summary> + /// Test EnvironmentsCreate + /// </summary> + [Fact] + public void EnvironmentsCreateTest() + { + // TODO uncomment below to test the method and replace null with proper value + //NewEnvironmentModel? newEnvironmentModel = null; + //instance.EnvironmentsCreate(newEnvironmentModel); + } + + /// <summary> + /// Test EnvironmentsDelete + /// </summary> + [Fact] + public void EnvironmentsDeleteTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List<string>? complexIds = null; + //string? appProjectId = null; + //instance.EnvironmentsDelete(complexIds, appProjectId); + } + + /// <summary> + /// Test EnvironmentsDownloadManifest + /// </summary> + [Fact] + public void EnvironmentsDownloadManifestTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string appProject = null; + //string appName = null; + //instance.EnvironmentsDownloadManifest(appProject, appName); + } + + /// <summary> + /// Test EnvironmentsGetClusters + /// </summary> + [Fact] + public void EnvironmentsGetClustersTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.EnvironmentsGetClusters(); + } + + /// <summary> + /// Test EnvironmentsGetEnvironment + /// </summary> + [Fact] + public void EnvironmentsGetEnvironmentTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string envName = null; + //var response = instance.EnvironmentsGetEnvironment(envName); + //Assert.IsType<List<CloudEnvironment>>(response); + } + + /// <summary> + /// Test EnvironmentsGetEnvironment_0 + /// </summary> + [Fact] + public void EnvironmentsGetEnvironment_0Test() + { + // TODO uncomment below to test the method and replace null with proper value + //string organizationName = null; + //string envName = null; + //var response = instance.EnvironmentsGetEnvironment_0(organizationName, envName); + //Assert.IsType<List<CloudEnvironment>>(response); + } + + /// <summary> + /// Test EnvironmentsGetImageTags + /// </summary> + [Fact] + public void EnvironmentsGetImageTagsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string? imageName = null; + //instance.EnvironmentsGetImageTags(imageName); + } + + /// <summary> + /// Test EnvironmentsGetImages + /// </summary> + [Fact] + public void EnvironmentsGetImagesTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string appProjectName = null; + //instance.EnvironmentsGetImages(appProjectName); + } + + /// <summary> + /// Test EnvironmentsGetLimits + /// </summary> + [Fact] + public void EnvironmentsGetLimitsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.EnvironmentsGetLimits(); + } + + /// <summary> + /// Test EnvironmentsGetServicePlan + /// </summary> + [Fact] + public void EnvironmentsGetServicePlanTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string name = null; + //instance.EnvironmentsGetServicePlan(name); + } + + /// <summary> + /// Test EnvironmentsGetSummary + /// </summary> + [Fact] + public void EnvironmentsGetSummaryTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.EnvironmentsGetSummary(); + } + + /// <summary> + /// Test EnvironmentsGetTier + /// </summary> + [Fact] + public void EnvironmentsGetTierTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.EnvironmentsGetTier(); + } + + /// <summary> + /// Test EnvironmentsList + /// </summary> + [Fact] + public void EnvironmentsListTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.EnvironmentsList(); + //Assert.IsType<List<CloudEnvironment>>(response); + } + + /// <summary> + /// Test EnvironmentsUpdate + /// </summary> + [Fact] + public void EnvironmentsUpdateTest() + { + // TODO uncomment below to test the method and replace null with proper value + //CloudEnvironment? cloudEnvironment = null; + //instance.EnvironmentsUpdate(cloudEnvironment); + } + + /// <summary> + /// Test EnvironmentsUpdate_0 + /// </summary> + [Fact] + public void EnvironmentsUpdate_0Test() + { + // TODO uncomment below to test the method and replace null with proper value + //string? manifest = null; + //string? appProject = null; + //instance.EnvironmentsUpdate_0(manifest, appProject); + } + + /// <summary> + /// Test EnvironmentsValidateName + /// </summary> + [Fact] + public void EnvironmentsValidateNameTest() + { + // TODO uncomment below to test the method and replace null with proper value + //EnvironmentNameValidationRequest? environmentNameValidationRequest = null; + //instance.EnvironmentsValidateName(environmentNameValidationRequest); + } + + /// <summary> + /// Test MetricsGetMetrics + /// </summary> + [Fact] + public void MetricsGetMetricsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Object? body = null; + //instance.MetricsGetMetrics(body); + } + + /// <summary> + /// Test RssGetNews + /// </summary> + [Fact] + public void RssGetNewsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.RssGetNews(); + } + + /// <summary> + /// Test SystemVersion + /// </summary> + [Fact] + public void SystemVersionTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Object? body = null; + //instance.SystemVersion(body); + } + + /// <summary> + /// Test TemplatesGetClusters + /// </summary> + [Fact] + public void TemplatesGetClustersTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.TemplatesGetClusters(); + } + + /// <summary> + /// Test TemplatesGetServicePlan + /// </summary> + [Fact] + public void TemplatesGetServicePlanTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string name = null; + //instance.TemplatesGetServicePlan(name); + } + + /// <summary> + /// Test TemplatesGetServicePlans + /// </summary> + [Fact] + public void TemplatesGetServicePlansTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.TemplatesGetServicePlans(); + } + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/CloudEnvironmentTests.cs b/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/CloudEnvironmentTests.cs new file mode 100644 index 0000000..61385f5 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/CloudEnvironmentTests.cs @@ -0,0 +1,165 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using VirtoCloud.Client.Model; +using VirtoCloud.Client.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace VirtoCloud.Client.Test.Model +{ + /// <summary> + /// Class for testing CloudEnvironment + /// </summary> + /// <remarks> + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// </remarks> + public class CloudEnvironmentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for CloudEnvironment + //private CloudEnvironment instance; + + public CloudEnvironmentTests() + { + // TODO uncomment below to create an instance of CloudEnvironment + //instance = new CloudEnvironment(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// <summary> + /// Test an instance of CloudEnvironment + /// </summary> + [Fact] + public void CloudEnvironmentInstanceTest() + { + // TODO uncomment below to test "IsType" CloudEnvironment + //Assert.IsType<CloudEnvironment>(instance); + } + + /// <summary> + /// Test the property 'Labels' + /// </summary> + [Fact] + public void LabelsTest() + { + // TODO unit test for the property 'Labels' + } + + /// <summary> + /// Test the property 'AppProjectId' + /// </summary> + [Fact] + public void AppProjectIdTest() + { + // TODO unit test for the property 'AppProjectId' + } + + /// <summary> + /// Test the property 'MetadataName' + /// </summary> + [Fact] + public void MetadataNameTest() + { + // TODO unit test for the property 'MetadataName' + } + + /// <summary> + /// Test the property 'TenantId' + /// </summary> + [Fact] + public void TenantIdTest() + { + // TODO unit test for the property 'TenantId' + } + + /// <summary> + /// Test the property 'Id' + /// </summary> + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// <summary> + /// Test the property 'Name' + /// </summary> + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + /// <summary> + /// Test the property 'Status' + /// </summary> + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + /// <summary> + /// Test the property 'SyncStatus' + /// </summary> + [Fact] + public void SyncStatusTest() + { + // TODO unit test for the property 'SyncStatus' + } + + /// <summary> + /// Test the property 'Created' + /// </summary> + [Fact] + public void CreatedTest() + { + // TODO unit test for the property 'Created' + } + + /// <summary> + /// Test the property 'Updated' + /// </summary> + [Fact] + public void UpdatedTest() + { + // TODO unit test for the property 'Updated' + } + + /// <summary> + /// Test the property 'Urls' + /// </summary> + [Fact] + public void UrlsTest() + { + // TODO unit test for the property 'Urls' + } + + /// <summary> + /// Test the property 'Helm' + /// </summary> + [Fact] + public void HelmTest() + { + // TODO unit test for the property 'Helm' + } + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/EnvironmentNameValidationRequestTests.cs b/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/EnvironmentNameValidationRequestTests.cs new file mode 100644 index 0000000..4c47b80 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/EnvironmentNameValidationRequestTests.cs @@ -0,0 +1,75 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using VirtoCloud.Client.Model; +using VirtoCloud.Client.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace VirtoCloud.Client.Test.Model +{ + /// <summary> + /// Class for testing EnvironmentNameValidationRequest + /// </summary> + /// <remarks> + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// </remarks> + public class EnvironmentNameValidationRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnvironmentNameValidationRequest + //private EnvironmentNameValidationRequest instance; + + public EnvironmentNameValidationRequestTests() + { + // TODO uncomment below to create an instance of EnvironmentNameValidationRequest + //instance = new EnvironmentNameValidationRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// <summary> + /// Test an instance of EnvironmentNameValidationRequest + /// </summary> + [Fact] + public void EnvironmentNameValidationRequestInstanceTest() + { + // TODO uncomment below to test "IsType" EnvironmentNameValidationRequest + //Assert.IsType<EnvironmentNameValidationRequest>(instance); + } + + /// <summary> + /// Test the property 'AppProject' + /// </summary> + [Fact] + public void AppProjectTest() + { + // TODO unit test for the property 'AppProject' + } + + /// <summary> + /// Test the property 'Name' + /// </summary> + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/HelmObjectTests.cs b/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/HelmObjectTests.cs new file mode 100644 index 0000000..d54f70b --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/HelmObjectTests.cs @@ -0,0 +1,66 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using VirtoCloud.Client.Model; +using VirtoCloud.Client.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace VirtoCloud.Client.Test.Model +{ + /// <summary> + /// Class for testing HelmObject + /// </summary> + /// <remarks> + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// </remarks> + public class HelmObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HelmObject + //private HelmObject instance; + + public HelmObjectTests() + { + // TODO uncomment below to create an instance of HelmObject + //instance = new HelmObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// <summary> + /// Test an instance of HelmObject + /// </summary> + [Fact] + public void HelmObjectInstanceTest() + { + // TODO uncomment below to test "IsType" HelmObject + //Assert.IsType<HelmObject>(instance); + } + + /// <summary> + /// Test the property 'Parameters' + /// </summary> + [Fact] + public void ParametersTest() + { + // TODO unit test for the property 'Parameters' + } + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/HelmTests.cs b/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/HelmTests.cs new file mode 100644 index 0000000..c780403 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/HelmTests.cs @@ -0,0 +1,66 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using VirtoCloud.Client.Model; +using VirtoCloud.Client.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace VirtoCloud.Client.Test.Model +{ + /// <summary> + /// Class for testing Helm + /// </summary> + /// <remarks> + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// </remarks> + public class HelmTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Helm + //private Helm instance; + + public HelmTests() + { + // TODO uncomment below to create an instance of Helm + //instance = new Helm(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// <summary> + /// Test an instance of Helm + /// </summary> + [Fact] + public void HelmInstanceTest() + { + // TODO uncomment below to test "IsType" Helm + //Assert.IsType<Helm>(instance); + } + + /// <summary> + /// Test the property 'Parameters' + /// </summary> + [Fact] + public void ParametersTest() + { + // TODO unit test for the property 'Parameters' + } + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/NewEnvironmentModelTests.cs b/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/NewEnvironmentModelTests.cs new file mode 100644 index 0000000..26c5c68 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client.Test/Model/NewEnvironmentModelTests.cs @@ -0,0 +1,120 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using VirtoCloud.Client.Model; +using VirtoCloud.Client.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace VirtoCloud.Client.Test.Model +{ + /// <summary> + /// Class for testing NewEnvironmentModel + /// </summary> + /// <remarks> + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// </remarks> + public class NewEnvironmentModelTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NewEnvironmentModel + //private NewEnvironmentModel instance; + + public NewEnvironmentModelTests() + { + // TODO uncomment below to create an instance of NewEnvironmentModel + //instance = new NewEnvironmentModel(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// <summary> + /// Test an instance of NewEnvironmentModel + /// </summary> + [Fact] + public void NewEnvironmentModelInstanceTest() + { + // TODO uncomment below to test "IsType" NewEnvironmentModel + //Assert.IsType<NewEnvironmentModel>(instance); + } + + /// <summary> + /// Test the property 'Name' + /// </summary> + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + /// <summary> + /// Test the property 'DbName' + /// </summary> + [Fact] + public void DbNameTest() + { + // TODO unit test for the property 'DbName' + } + + /// <summary> + /// Test the property 'AppProjectId' + /// </summary> + [Fact] + public void AppProjectIdTest() + { + // TODO unit test for the property 'AppProjectId' + } + + /// <summary> + /// Test the property 'Cluster' + /// </summary> + [Fact] + public void ClusterTest() + { + // TODO unit test for the property 'Cluster' + } + + /// <summary> + /// Test the property 'ServicePlan' + /// </summary> + [Fact] + public void ServicePlanTest() + { + // TODO unit test for the property 'ServicePlan' + } + + /// <summary> + /// Test the property 'DbProvider' + /// </summary> + [Fact] + public void DbProviderTest() + { + // TODO unit test for the property 'DbProvider' + } + + /// <summary> + /// Test the property 'Helm' + /// </summary> + [Fact] + public void HelmTest() + { + // TODO unit test for the property 'Helm' + } + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client.Test/VirtoCloud.Client.Test.csproj b/src/Virtocloud.Client/src/VirtoCloud.Client.Test/VirtoCloud.Client.Test.csproj new file mode 100644 index 0000000..45eaebc --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client.Test/VirtoCloud.Client.Test.csproj @@ -0,0 +1,20 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <AssemblyName>VirtoCloud.Client.Test</AssemblyName> + <RootNamespace>VirtoCloud.Client.Test</RootNamespace> + <TargetFramework>net6.0</TargetFramework> + <IsPackable>false</IsPackable> + <Nullable>annotations</Nullable> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" /> + <PackageReference Include="xunit" Version="2.6.1" /> + <PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" /> + </ItemGroup> + + <ItemGroup> + <ProjectReference Include="..\VirtoCloud.Client\VirtoCloud.Client.csproj" /> + </ItemGroup> +</Project> diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Api/SaaSDeploymentApi.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Api/SaaSDeploymentApi.cs new file mode 100644 index 0000000..bc1e471 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Api/SaaSDeploymentApi.cs @@ -0,0 +1,5453 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Mime; +using VirtoCloud.Client.Client; +using VirtoCloud.Client.Model; + +namespace VirtoCloud.Client.Api +{ + + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public interface ISaaSDeploymentApiSync : IApiAccessor + { + #region Synchronous Operations + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns></returns> + void AppProjectsCreate(Object? body = default(Object?)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> AppProjectsCreateWithHttpInfo(Object? body = default(Object?)); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns></returns> + void AppProjectsDelete(Object? body = default(Object?)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> AppProjectsDeleteWithHttpInfo(Object? body = default(Object?)); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + void AppProjectsGetOrganizationsList(); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> AppProjectsGetOrganizationsListWithHttpInfo(); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + void AppProjectsList(); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> AppProjectsListWithHttpInfo(); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns></returns> + void AppProjectsUpdate(Object? body = default(Object?)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> AppProjectsUpdateWithHttpInfo(Object? body = default(Object?)); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + void AppsKibana(); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> AppsKibanaWithHttpInfo(); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + void CacheClear(); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> CacheClearWithHttpInfo(); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="path"></param> + /// <returns></returns> + void DocsGetContent(string path); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="path"></param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> DocsGetContentWithHttpInfo(string path); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + void DocsGetMenu(); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> DocsGetMenuWithHttpInfo(); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <returns></returns> + void EnvironmentsCanCreate(string appProject); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsCanCreateWithHttpInfo(string appProject); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <returns></returns> + void EnvironmentsCanSave(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsCanSaveWithHttpInfo(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?)); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="newEnvironmentModel"> (optional)</param> + /// <returns></returns> + void EnvironmentsCreate(NewEnvironmentModel? newEnvironmentModel = default(NewEnvironmentModel?)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="newEnvironmentModel"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsCreateWithHttpInfo(NewEnvironmentModel? newEnvironmentModel = default(NewEnvironmentModel?)); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="complexIds"> (optional)</param> + /// <param name="appProjectId"> (optional)</param> + /// <returns></returns> + void EnvironmentsDelete(List<string>? complexIds = default(List<string>?), string? appProjectId = default(string?)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="complexIds"> (optional)</param> + /// <param name="appProjectId"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsDeleteWithHttpInfo(List<string>? complexIds = default(List<string>?), string? appProjectId = default(string?)); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <param name="appName"></param> + /// <returns></returns> + void EnvironmentsDownloadManifest(string appProject, string appName); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <param name="appName"></param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsDownloadManifestWithHttpInfo(string appProject, string appName); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + void EnvironmentsGetClusters(); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsGetClustersWithHttpInfo(); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="envName"></param> + /// <returns>List<CloudEnvironment></returns> + List<CloudEnvironment> EnvironmentsGetEnvironment(string envName); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="envName"></param> + /// <returns>ApiResponse of List<CloudEnvironment></returns> + ApiResponse<List<CloudEnvironment>> EnvironmentsGetEnvironmentWithHttpInfo(string envName); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="organizationName"></param> + /// <param name="envName"></param> + /// <returns>List<CloudEnvironment></returns> + List<CloudEnvironment> EnvironmentsGetEnvironment_0(string organizationName, string envName); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="organizationName"></param> + /// <param name="envName"></param> + /// <returns>ApiResponse of List<CloudEnvironment></returns> + ApiResponse<List<CloudEnvironment>> EnvironmentsGetEnvironment_0WithHttpInfo(string organizationName, string envName); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="imageName"> (optional)</param> + /// <returns></returns> + void EnvironmentsGetImageTags(string? imageName = default(string?)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="imageName"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsGetImageTagsWithHttpInfo(string? imageName = default(string?)); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProjectName"></param> + /// <returns></returns> + void EnvironmentsGetImages(string appProjectName); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProjectName"></param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsGetImagesWithHttpInfo(string appProjectName); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + void EnvironmentsGetLimits(); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsGetLimitsWithHttpInfo(); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <returns></returns> + void EnvironmentsGetServicePlan(string name); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsGetServicePlanWithHttpInfo(string name); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + void EnvironmentsGetSummary(); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsGetSummaryWithHttpInfo(); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + void EnvironmentsGetTier(); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsGetTierWithHttpInfo(); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>List<CloudEnvironment></returns> + List<CloudEnvironment> EnvironmentsList(); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of List<CloudEnvironment></returns> + ApiResponse<List<CloudEnvironment>> EnvironmentsListWithHttpInfo(); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <returns></returns> + void EnvironmentsUpdate(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsUpdateWithHttpInfo(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?)); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="manifest"> (optional)</param> + /// <param name="appProject"> (optional)</param> + /// <returns></returns> + void EnvironmentsUpdate_0(string? manifest = default(string?), string? appProject = default(string?)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="manifest"> (optional)</param> + /// <param name="appProject"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsUpdate_0WithHttpInfo(string? manifest = default(string?), string? appProject = default(string?)); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="environmentNameValidationRequest"> (optional)</param> + /// <returns></returns> + void EnvironmentsValidateName(EnvironmentNameValidationRequest? environmentNameValidationRequest = default(EnvironmentNameValidationRequest?)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="environmentNameValidationRequest"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> EnvironmentsValidateNameWithHttpInfo(EnvironmentNameValidationRequest? environmentNameValidationRequest = default(EnvironmentNameValidationRequest?)); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns></returns> + void MetricsGetMetrics(Object? body = default(Object?)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> MetricsGetMetricsWithHttpInfo(Object? body = default(Object?)); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + void RssGetNews(); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> RssGetNewsWithHttpInfo(); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns></returns> + void SystemVersion(Object? body = default(Object?)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> SystemVersionWithHttpInfo(Object? body = default(Object?)); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + void TemplatesGetClusters(); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> TemplatesGetClustersWithHttpInfo(); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <returns></returns> + void TemplatesGetServicePlan(string name); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> TemplatesGetServicePlanWithHttpInfo(string name); + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + void TemplatesGetServicePlans(); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + ApiResponse<Object> TemplatesGetServicePlansWithHttpInfo(); + #endregion Synchronous Operations + } + + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public interface ISaaSDeploymentApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task AppProjectsCreateAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> AppProjectsCreateWithHttpInfoAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task AppProjectsDeleteAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> AppProjectsDeleteWithHttpInfoAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task AppProjectsGetOrganizationsListAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> AppProjectsGetOrganizationsListWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task AppProjectsListAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> AppProjectsListWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task AppProjectsUpdateAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> AppProjectsUpdateWithHttpInfoAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task AppsKibanaAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> AppsKibanaWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task CacheClearAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> CacheClearWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="path"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task DocsGetContentAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="path"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> DocsGetContentWithHttpInfoAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task DocsGetMenuAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> DocsGetMenuWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsCanCreateAsync(string appProject, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsCanCreateWithHttpInfoAsync(string appProject, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsCanSaveAsync(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsCanSaveWithHttpInfoAsync(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="newEnvironmentModel"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsCreateAsync(NewEnvironmentModel? newEnvironmentModel = default(NewEnvironmentModel?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="newEnvironmentModel"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsCreateWithHttpInfoAsync(NewEnvironmentModel? newEnvironmentModel = default(NewEnvironmentModel?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="complexIds"> (optional)</param> + /// <param name="appProjectId"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsDeleteAsync(List<string>? complexIds = default(List<string>?), string? appProjectId = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="complexIds"> (optional)</param> + /// <param name="appProjectId"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsDeleteWithHttpInfoAsync(List<string>? complexIds = default(List<string>?), string? appProjectId = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <param name="appName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsDownloadManifestAsync(string appProject, string appName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <param name="appName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsDownloadManifestWithHttpInfoAsync(string appProject, string appName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsGetClustersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsGetClustersWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="envName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of List<CloudEnvironment></returns> + System.Threading.Tasks.Task<CloudEnvironment> EnvironmentsGetEnvironmentAsync(string envName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="envName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse (List<CloudEnvironment>)</returns> + System.Threading.Tasks.Task<ApiResponse<CloudEnvironment>> EnvironmentsGetEnvironmentWithHttpInfoAsync(string envName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="organizationName"></param> + /// <param name="envName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of List<CloudEnvironment></returns> + System.Threading.Tasks.Task<List<CloudEnvironment>> EnvironmentsGetEnvironment_0Async(string organizationName, string envName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="organizationName"></param> + /// <param name="envName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse (List<CloudEnvironment>)</returns> + System.Threading.Tasks.Task<ApiResponse<List<CloudEnvironment>>> EnvironmentsGetEnvironment_0WithHttpInfoAsync(string organizationName, string envName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="imageName"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsGetImageTagsAsync(string? imageName = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="imageName"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsGetImageTagsWithHttpInfoAsync(string? imageName = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProjectName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsGetImagesAsync(string appProjectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProjectName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsGetImagesWithHttpInfoAsync(string appProjectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsGetLimitsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsGetLimitsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsGetServicePlanAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsGetServicePlanWithHttpInfoAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsGetSummaryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsGetSummaryWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsGetTierAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsGetTierWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of List<CloudEnvironment></returns> + System.Threading.Tasks.Task<List<CloudEnvironment>> EnvironmentsListAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse (List<CloudEnvironment>)</returns> + System.Threading.Tasks.Task<ApiResponse<List<CloudEnvironment>>> EnvironmentsListWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsUpdateAsync(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsUpdateWithHttpInfoAsync(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="manifest"> (optional)</param> + /// <param name="appProject"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsUpdate_0Async(string? manifest = default(string?), string? appProject = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="manifest"> (optional)</param> + /// <param name="appProject"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsUpdate_0WithHttpInfoAsync(string? manifest = default(string?), string? appProject = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="environmentNameValidationRequest"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task EnvironmentsValidateNameAsync(EnvironmentNameValidationRequest? environmentNameValidationRequest = default(EnvironmentNameValidationRequest?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="environmentNameValidationRequest"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> EnvironmentsValidateNameWithHttpInfoAsync(EnvironmentNameValidationRequest? environmentNameValidationRequest = default(EnvironmentNameValidationRequest?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task MetricsGetMetricsAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> MetricsGetMetricsWithHttpInfoAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task RssGetNewsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> RssGetNewsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task SystemVersionAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> SystemVersionWithHttpInfoAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task TemplatesGetClustersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> TemplatesGetClustersWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task TemplatesGetServicePlanAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> TemplatesGetServicePlanWithHttpInfoAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + System.Threading.Tasks.Task TemplatesGetServicePlansAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// + /// </summary> + /// <remarks> + /// + /// </remarks> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + System.Threading.Tasks.Task<ApiResponse<Object>> TemplatesGetServicePlansWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public interface ISaaSDeploymentApi : ISaaSDeploymentApiSync, ISaaSDeploymentApiAsync + { + + } + + /// <summary> + /// Represents a collection of functions to interact with the API endpoints + /// </summary> + public partial class SaaSDeploymentApi : IDisposable, ISaaSDeploymentApi + { + private VirtoCloud.Client.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// <summary> + /// Initializes a new instance of the <see cref="SaaSDeploymentApi"/> class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHandler</see>. + /// </summary> + /// <returns></returns> + public SaaSDeploymentApi() : this((string)null) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref="SaaSDeploymentApi"/> class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHandler</see>. + /// </summary> + /// <param name="basePath">The target service's base path in URL format.</param> + /// <exception cref="ArgumentException"></exception> + /// <returns></returns> + public SaaSDeploymentApi(string basePath) + { + this.Configuration = VirtoCloud.Client.Client.Configuration.MergeConfigurations( + VirtoCloud.Client.Client.GlobalConfiguration.Instance, + new VirtoCloud.Client.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new VirtoCloud.Client.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + this.ExceptionFactory = VirtoCloud.Client.Client.Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Initializes a new instance of the <see cref="SaaSDeploymentApi"/> class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHandler</see>. + /// </summary> + /// <param name="configuration">An instance of Configuration.</param> + /// <exception cref="ArgumentNullException"></exception> + /// <returns></returns> + public SaaSDeploymentApi(VirtoCloud.Client.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = VirtoCloud.Client.Client.Configuration.MergeConfigurations( + VirtoCloud.Client.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new VirtoCloud.Client.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + ExceptionFactory = VirtoCloud.Client.Client.Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Initializes a new instance of the <see cref="SaaSDeploymentApi"/> class. + /// </summary> + /// <param name="client">An instance of HttpClient.</param> + /// <param name="handler">An optional instance of HttpClientHandler that is used by HttpClient.</param> + /// <exception cref="ArgumentNullException"></exception> + /// <returns></returns> + /// <remarks> + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// </remarks> + public SaaSDeploymentApi(HttpClient client, HttpClientHandler handler = null) : this(client, (string)null, handler) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref="SaaSDeploymentApi"/> class. + /// </summary> + /// <param name="client">An instance of HttpClient.</param> + /// <param name="basePath">The target service's base path in URL format.</param> + /// <param name="handler">An optional instance of HttpClientHandler that is used by HttpClient.</param> + /// <exception cref="ArgumentNullException"></exception> + /// <exception cref="ArgumentException"></exception> + /// <returns></returns> + /// <remarks> + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// </remarks> + public SaaSDeploymentApi(HttpClient client, string basePath, HttpClientHandler handler = null) + { + if (client == null) throw new ArgumentNullException("client"); + + this.Configuration = VirtoCloud.Client.Client.Configuration.MergeConfigurations( + VirtoCloud.Client.Client.GlobalConfiguration.Instance, + new VirtoCloud.Client.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new VirtoCloud.Client.Client.ApiClient(client, this.Configuration.BasePath, handler); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + this.ExceptionFactory = VirtoCloud.Client.Client.Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Initializes a new instance of the <see cref="SaaSDeploymentApi"/> class using Configuration object. + /// </summary> + /// <param name="client">An instance of HttpClient.</param> + /// <param name="configuration">An instance of Configuration.</param> + /// <param name="handler">An optional instance of HttpClientHandler that is used by HttpClient.</param> + /// <exception cref="ArgumentNullException"></exception> + /// <returns></returns> + /// <remarks> + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// </remarks> + public SaaSDeploymentApi(HttpClient client, VirtoCloud.Client.Client.Configuration configuration, HttpClientHandler handler = null) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + if (client == null) throw new ArgumentNullException("client"); + + this.Configuration = VirtoCloud.Client.Client.Configuration.MergeConfigurations( + VirtoCloud.Client.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new VirtoCloud.Client.Client.ApiClient(client, this.Configuration.BasePath, handler); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + ExceptionFactory = VirtoCloud.Client.Client.Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Initializes a new instance of the <see cref="SaaSDeploymentApi"/> class + /// using a Configuration object and client instance. + /// </summary> + /// <param name="client">The client interface for synchronous API access.</param> + /// <param name="asyncClient">The client interface for asynchronous API access.</param> + /// <param name="configuration">The configuration object.</param> + /// <exception cref="ArgumentNullException"></exception> + public SaaSDeploymentApi(VirtoCloud.Client.Client.ISynchronousClient client, VirtoCloud.Client.Client.IAsynchronousClient asyncClient, VirtoCloud.Client.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 = VirtoCloud.Client.Client.Configuration.DefaultExceptionFactory; + } + + /// <summary> + /// Disposes resources if they were created by us + /// </summary> + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// <summary> + /// Holds the ApiClient if created + /// </summary> + public VirtoCloud.Client.Client.ApiClient ApiClient { get; set; } = null; + + /// <summary> + /// The client for accessing this underlying API asynchronously. + /// </summary> + public VirtoCloud.Client.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// <summary> + /// The client for accessing this underlying API synchronously. + /// </summary> + public VirtoCloud.Client.Client.ISynchronousClient Client { get; set; } + + /// <summary> + /// Gets the base path of the API client. + /// </summary> + /// <value>The base path</value> + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// <summary> + /// Gets or sets the configuration object + /// </summary> + /// <value>An instance of the Configuration</value> + public VirtoCloud.Client.Client.IReadableConfiguration Configuration { get; set; } + + /// <summary> + /// Provides a factory method hook for the creation of exceptions. + /// </summary> + public VirtoCloud.Client.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; } + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns></returns> + public void AppProjectsCreate(Object? body = default(Object?)) + { + AppProjectsCreateWithHttpInfo(body); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> AppProjectsCreateWithHttpInfo(Object? body = default(Object?)) + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = body; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post<Object>("/api/saas/app-projects/create", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AppProjectsCreate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task AppProjectsCreateAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await AppProjectsCreateWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> AppProjectsCreateWithHttpInfoAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = body; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/api/saas/app-projects/create", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AppProjectsCreate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns></returns> + public void AppProjectsDelete(Object? body = default(Object?)) + { + AppProjectsDeleteWithHttpInfo(body); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> AppProjectsDeleteWithHttpInfo(Object? body = default(Object?)) + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = body; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post<Object>("/api/saas/app-projects/delete", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AppProjectsDelete", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task AppProjectsDeleteAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await AppProjectsDeleteWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> AppProjectsDeleteWithHttpInfoAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = body; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/api/saas/app-projects/delete", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AppProjectsDelete", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + public void AppProjectsGetOrganizationsList() + { + AppProjectsGetOrganizationsListWithHttpInfo(); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> AppProjectsGetOrganizationsListWithHttpInfo() + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/app-projects/org-list", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AppProjectsGetOrganizationsList", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task AppProjectsGetOrganizationsListAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await AppProjectsGetOrganizationsListWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> AppProjectsGetOrganizationsListWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/app-projects/org-list", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AppProjectsGetOrganizationsList", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + public void AppProjectsList() + { + AppProjectsListWithHttpInfo(); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> AppProjectsListWithHttpInfo() + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/app-projects/list", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AppProjectsList", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task AppProjectsListAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await AppProjectsListWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> AppProjectsListWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/app-projects/list", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AppProjectsList", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns></returns> + public void AppProjectsUpdate(Object? body = default(Object?)) + { + AppProjectsUpdateWithHttpInfo(body); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> AppProjectsUpdateWithHttpInfo(Object? body = default(Object?)) + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = body; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put<Object>("/api/saas/app-projects/update", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AppProjectsUpdate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task AppProjectsUpdateAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await AppProjectsUpdateWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> AppProjectsUpdateWithHttpInfoAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = body; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync<Object>("/api/saas/app-projects/update", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AppProjectsUpdate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + public void AppsKibana() + { + AppsKibanaWithHttpInfo(); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> AppsKibanaWithHttpInfo() + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/apps/kibana", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AppsKibana", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task AppsKibanaAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await AppsKibanaWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> AppsKibanaWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/apps/kibana", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AppsKibana", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + public void CacheClear() + { + CacheClearWithHttpInfo(); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> CacheClearWithHttpInfo() + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/cache/clear", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CacheClear", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task CacheClearAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await CacheClearWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> CacheClearWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/cache/clear", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CacheClear", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="path"></param> + /// <returns></returns> + public void DocsGetContent(string path) + { + DocsGetContentWithHttpInfo(path); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="path"></param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> DocsGetContentWithHttpInfo(string path) + { + // verify the required parameter 'path' is set + if (path == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'path' when calling SaaSDeploymentApi->DocsGetContent"); + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("path", VirtoCloud.Client.Client.ClientUtils.ParameterToString(path)); // path parameter + + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/Docs/content/{path}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DocsGetContent", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="path"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task DocsGetContentAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await DocsGetContentWithHttpInfoAsync(path, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="path"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> DocsGetContentWithHttpInfoAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'path' is set + if (path == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'path' when calling SaaSDeploymentApi->DocsGetContent"); + + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("path", VirtoCloud.Client.Client.ClientUtils.ParameterToString(path)); // path parameter + + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/Docs/content/{path}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DocsGetContent", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + public void DocsGetMenu() + { + DocsGetMenuWithHttpInfo(); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> DocsGetMenuWithHttpInfo() + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/Docs/menu", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DocsGetMenu", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task DocsGetMenuAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await DocsGetMenuWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> DocsGetMenuWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/Docs/menu", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DocsGetMenu", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <returns></returns> + public void EnvironmentsCanCreate(string appProject) + { + EnvironmentsCanCreateWithHttpInfo(appProject); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsCanCreateWithHttpInfo(string appProject) + { + // verify the required parameter 'appProject' is set + if (appProject == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'appProject' when calling SaaSDeploymentApi->EnvironmentsCanCreate"); + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("appProject", VirtoCloud.Client.Client.ClientUtils.ParameterToString(appProject)); // path parameter + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/environments/can-create/{appProject}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsCanCreate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsCanCreateAsync(string appProject, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsCanCreateWithHttpInfoAsync(appProject, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsCanCreateWithHttpInfoAsync(string appProject, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'appProject' is set + if (appProject == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'appProject' when calling SaaSDeploymentApi->EnvironmentsCanCreate"); + + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("appProject", VirtoCloud.Client.Client.ClientUtils.ParameterToString(appProject)); // path parameter + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/environments/can-create/{appProject}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsCanCreate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <returns></returns> + public void EnvironmentsCanSave(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?)) + { + EnvironmentsCanSaveWithHttpInfo(cloudEnvironment); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsCanSaveWithHttpInfo(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?)) + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = cloudEnvironment; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post<Object>("/api/saas/environments/can-save", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsCanSave", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsCanSaveAsync(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsCanSaveWithHttpInfoAsync(cloudEnvironment, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsCanSaveWithHttpInfoAsync(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = cloudEnvironment; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/api/saas/environments/can-save", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsCanSave", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="newEnvironmentModel"> (optional)</param> + /// <returns></returns> + public void EnvironmentsCreate(NewEnvironmentModel? newEnvironmentModel = default(NewEnvironmentModel?)) + { + EnvironmentsCreateWithHttpInfo(newEnvironmentModel); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="newEnvironmentModel"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsCreateWithHttpInfo(NewEnvironmentModel? newEnvironmentModel = default(NewEnvironmentModel?)) + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = newEnvironmentModel; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post<Object>("/api/saas/environments", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsCreate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="newEnvironmentModel"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsCreateAsync(NewEnvironmentModel? newEnvironmentModel = default(NewEnvironmentModel?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsCreateWithHttpInfoAsync(newEnvironmentModel, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="newEnvironmentModel"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsCreateWithHttpInfoAsync(NewEnvironmentModel? newEnvironmentModel = default(NewEnvironmentModel?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = newEnvironmentModel; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/api/saas/environments", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsCreate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="complexIds"> (optional)</param> + /// <param name="appProjectId"> (optional)</param> + /// <returns></returns> + public void EnvironmentsDelete(List<string>? complexIds = default(List<string>?), string? appProjectId = default(string?)) + { + EnvironmentsDeleteWithHttpInfo(complexIds, appProjectId); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="complexIds"> (optional)</param> + /// <param name="appProjectId"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsDeleteWithHttpInfo(List<string>? complexIds = default(List<string>?), string? appProjectId = default(string?)) + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (complexIds != null) + { + localVarRequestOptions.QueryParameters.Add(VirtoCloud.Client.Client.ClientUtils.ParameterToMultiMap("multi", "complexIds", complexIds)); + } + if (appProjectId != null) + { + localVarRequestOptions.QueryParameters.Add(VirtoCloud.Client.Client.ClientUtils.ParameterToMultiMap("", "appProjectId", appProjectId)); + } + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete<Object>("/api/saas/environments", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsDelete", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="complexIds"> (optional)</param> + /// <param name="appProjectId"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsDeleteAsync(List<string>? complexIds = default(List<string>?), string? appProjectId = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsDeleteWithHttpInfoAsync(complexIds, appProjectId, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="complexIds"> (optional)</param> + /// <param name="appProjectId"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsDeleteWithHttpInfoAsync(List<string>? complexIds = default(List<string>?), string? appProjectId = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (complexIds != null) + { + localVarRequestOptions.QueryParameters.Add(VirtoCloud.Client.Client.ClientUtils.ParameterToMultiMap("multi", "complexIds", complexIds)); + } + if (appProjectId != null) + { + localVarRequestOptions.QueryParameters.Add(VirtoCloud.Client.Client.ClientUtils.ParameterToMultiMap("", "appProjectId", appProjectId)); + } + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.DeleteAsync<Object>("/api/saas/environments", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsDelete", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <param name="appName"></param> + /// <returns></returns> + public void EnvironmentsDownloadManifest(string appProject, string appName) + { + EnvironmentsDownloadManifestWithHttpInfo(appProject, appName); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <param name="appName"></param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsDownloadManifestWithHttpInfo(string appProject, string appName) + { + // verify the required parameter 'appProject' is set + if (appProject == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'appProject' when calling SaaSDeploymentApi->EnvironmentsDownloadManifest"); + + // verify the required parameter 'appName' is set + if (appName == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'appName' when calling SaaSDeploymentApi->EnvironmentsDownloadManifest"); + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("appProject", VirtoCloud.Client.Client.ClientUtils.ParameterToString(appProject)); // path parameter + localVarRequestOptions.PathParameters.Add("appName", VirtoCloud.Client.Client.ClientUtils.ParameterToString(appName)); // path parameter + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/environments/manifest/{appProject}/{appName}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsDownloadManifest", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <param name="appName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsDownloadManifestAsync(string appProject, string appName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsDownloadManifestWithHttpInfoAsync(appProject, appName, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProject"></param> + /// <param name="appName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsDownloadManifestWithHttpInfoAsync(string appProject, string appName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'appProject' is set + if (appProject == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'appProject' when calling SaaSDeploymentApi->EnvironmentsDownloadManifest"); + + // verify the required parameter 'appName' is set + if (appName == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'appName' when calling SaaSDeploymentApi->EnvironmentsDownloadManifest"); + + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("appProject", VirtoCloud.Client.Client.ClientUtils.ParameterToString(appProject)); // path parameter + localVarRequestOptions.PathParameters.Add("appName", VirtoCloud.Client.Client.ClientUtils.ParameterToString(appName)); // path parameter + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/environments/manifest/{appProject}/{appName}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsDownloadManifest", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + public void EnvironmentsGetClusters() + { + EnvironmentsGetClustersWithHttpInfo(); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsGetClustersWithHttpInfo() + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/environments/clusters", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetClusters", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsGetClustersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsGetClustersWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsGetClustersWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/environments/clusters", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetClusters", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="envName"></param> + /// <returns>List<CloudEnvironment></returns> + public List<CloudEnvironment> EnvironmentsGetEnvironment(string envName) + { + VirtoCloud.Client.Client.ApiResponse<List<CloudEnvironment>> localVarResponse = EnvironmentsGetEnvironmentWithHttpInfo(envName); + return localVarResponse.Data; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="envName"></param> + /// <returns>ApiResponse of List<CloudEnvironment></returns> + public VirtoCloud.Client.Client.ApiResponse<List<CloudEnvironment>> EnvironmentsGetEnvironmentWithHttpInfo(string envName) + { + // verify the required parameter 'envName' is set + if (envName == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'envName' when calling SaaSDeploymentApi->EnvironmentsGetEnvironment"); + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("envName", VirtoCloud.Client.Client.ClientUtils.ParameterToString(envName)); // path parameter + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<List<CloudEnvironment>>("/api/saas/environments/{envName}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetEnvironment", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="envName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of List<CloudEnvironment></returns> + public async System.Threading.Tasks.Task<CloudEnvironment> EnvironmentsGetEnvironmentAsync(string envName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + VirtoCloud.Client.Client.ApiResponse<CloudEnvironment> localVarResponse = await EnvironmentsGetEnvironmentWithHttpInfoAsync(envName, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="envName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse (List<CloudEnvironment>)</returns> + public async System.Threading.Tasks.Task<ApiResponse<CloudEnvironment>> EnvironmentsGetEnvironmentWithHttpInfoAsync(string envName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'envName' is set + if (envName == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'envName' when calling SaaSDeploymentApi->EnvironmentsGetEnvironment"); + + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("envName", VirtoCloud.Client.Client.ClientUtils.ParameterToString(envName)); // path parameter + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<CloudEnvironment>("/api/saas/environments/{envName}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetEnvironment", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="organizationName"></param> + /// <param name="envName"></param> + /// <returns>List<CloudEnvironment></returns> + public List<CloudEnvironment> EnvironmentsGetEnvironment_0(string organizationName, string envName) + { + VirtoCloud.Client.Client.ApiResponse<List<CloudEnvironment>> localVarResponse = EnvironmentsGetEnvironment_0WithHttpInfo(organizationName, envName); + return localVarResponse.Data; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="organizationName"></param> + /// <param name="envName"></param> + /// <returns>ApiResponse of List<CloudEnvironment></returns> + public VirtoCloud.Client.Client.ApiResponse<List<CloudEnvironment>> EnvironmentsGetEnvironment_0WithHttpInfo(string organizationName, string envName) + { + // verify the required parameter 'organizationName' is set + if (organizationName == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'organizationName' when calling SaaSDeploymentApi->EnvironmentsGetEnvironment_0"); + + // verify the required parameter 'envName' is set + if (envName == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'envName' when calling SaaSDeploymentApi->EnvironmentsGetEnvironment_0"); + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("organizationName", VirtoCloud.Client.Client.ClientUtils.ParameterToString(organizationName)); // path parameter + localVarRequestOptions.PathParameters.Add("envName", VirtoCloud.Client.Client.ClientUtils.ParameterToString(envName)); // path parameter + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<List<CloudEnvironment>>("/api/saas/environments/{organizationName}/{envName}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetEnvironment_0", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="organizationName"></param> + /// <param name="envName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of List<CloudEnvironment></returns> + public async System.Threading.Tasks.Task<List<CloudEnvironment>> EnvironmentsGetEnvironment_0Async(string organizationName, string envName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + VirtoCloud.Client.Client.ApiResponse<List<CloudEnvironment>> localVarResponse = await EnvironmentsGetEnvironment_0WithHttpInfoAsync(organizationName, envName, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="organizationName"></param> + /// <param name="envName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse (List<CloudEnvironment>)</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<List<CloudEnvironment>>> EnvironmentsGetEnvironment_0WithHttpInfoAsync(string organizationName, string envName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'organizationName' is set + if (organizationName == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'organizationName' when calling SaaSDeploymentApi->EnvironmentsGetEnvironment_0"); + + // verify the required parameter 'envName' is set + if (envName == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'envName' when calling SaaSDeploymentApi->EnvironmentsGetEnvironment_0"); + + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("organizationName", VirtoCloud.Client.Client.ClientUtils.ParameterToString(organizationName)); // path parameter + localVarRequestOptions.PathParameters.Add("envName", VirtoCloud.Client.Client.ClientUtils.ParameterToString(envName)); // path parameter + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<List<CloudEnvironment>>("/api/saas/environments/{organizationName}/{envName}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetEnvironment_0", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="imageName"> (optional)</param> + /// <returns></returns> + public void EnvironmentsGetImageTags(string? imageName = default(string?)) + { + EnvironmentsGetImageTagsWithHttpInfo(imageName); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="imageName"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsGetImageTagsWithHttpInfo(string? imageName = default(string?)) + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (imageName != null) + { + localVarRequestOptions.QueryParameters.Add(VirtoCloud.Client.Client.ClientUtils.ParameterToMultiMap("", "imageName", imageName)); + } + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/environments/tags", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetImageTags", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="imageName"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsGetImageTagsAsync(string? imageName = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsGetImageTagsWithHttpInfoAsync(imageName, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="imageName"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsGetImageTagsWithHttpInfoAsync(string? imageName = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (imageName != null) + { + localVarRequestOptions.QueryParameters.Add(VirtoCloud.Client.Client.ClientUtils.ParameterToMultiMap("", "imageName", imageName)); + } + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/environments/tags", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetImageTags", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProjectName"></param> + /// <returns></returns> + public void EnvironmentsGetImages(string appProjectName) + { + EnvironmentsGetImagesWithHttpInfo(appProjectName); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProjectName"></param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsGetImagesWithHttpInfo(string appProjectName) + { + // verify the required parameter 'appProjectName' is set + if (appProjectName == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'appProjectName' when calling SaaSDeploymentApi->EnvironmentsGetImages"); + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("appProjectName", VirtoCloud.Client.Client.ClientUtils.ParameterToString(appProjectName)); // path parameter + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/environments/images/{appProjectName}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetImages", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProjectName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsGetImagesAsync(string appProjectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsGetImagesWithHttpInfoAsync(appProjectName, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="appProjectName"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsGetImagesWithHttpInfoAsync(string appProjectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'appProjectName' is set + if (appProjectName == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'appProjectName' when calling SaaSDeploymentApi->EnvironmentsGetImages"); + + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("appProjectName", VirtoCloud.Client.Client.ClientUtils.ParameterToString(appProjectName)); // path parameter + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/environments/images/{appProjectName}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetImages", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + public void EnvironmentsGetLimits() + { + EnvironmentsGetLimitsWithHttpInfo(); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsGetLimitsWithHttpInfo() + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/environments/limits", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetLimits", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsGetLimitsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsGetLimitsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsGetLimitsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/environments/limits", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetLimits", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <returns></returns> + public void EnvironmentsGetServicePlan(string name) + { + EnvironmentsGetServicePlanWithHttpInfo(name); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsGetServicePlanWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'name' when calling SaaSDeploymentApi->EnvironmentsGetServicePlan"); + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("name", VirtoCloud.Client.Client.ClientUtils.ParameterToString(name)); // path parameter + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/environments/service-plan/{name}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetServicePlan", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsGetServicePlanAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsGetServicePlanWithHttpInfoAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsGetServicePlanWithHttpInfoAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'name' is set + if (name == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'name' when calling SaaSDeploymentApi->EnvironmentsGetServicePlan"); + + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("name", VirtoCloud.Client.Client.ClientUtils.ParameterToString(name)); // path parameter + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/environments/service-plan/{name}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetServicePlan", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + public void EnvironmentsGetSummary() + { + EnvironmentsGetSummaryWithHttpInfo(); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsGetSummaryWithHttpInfo() + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/environments/summary", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetSummary", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsGetSummaryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsGetSummaryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsGetSummaryWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/environments/summary", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetSummary", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + public void EnvironmentsGetTier() + { + EnvironmentsGetTierWithHttpInfo(); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsGetTierWithHttpInfo() + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/environments/tier", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetTier", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsGetTierAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsGetTierWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsGetTierWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/environments/tier", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsGetTier", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>List<CloudEnvironment></returns> + public List<CloudEnvironment> EnvironmentsList() + { + VirtoCloud.Client.Client.ApiResponse<List<CloudEnvironment>> localVarResponse = EnvironmentsListWithHttpInfo(); + return localVarResponse.Data; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of List<CloudEnvironment></returns> + public VirtoCloud.Client.Client.ApiResponse<List<CloudEnvironment>> EnvironmentsListWithHttpInfo() + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<List<CloudEnvironment>>("/api/saas/environments", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsList", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of List<CloudEnvironment></returns> + public async System.Threading.Tasks.Task<List<CloudEnvironment>> EnvironmentsListAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + VirtoCloud.Client.Client.ApiResponse<List<CloudEnvironment>> localVarResponse = await EnvironmentsListWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse (List<CloudEnvironment>)</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<List<CloudEnvironment>>> EnvironmentsListWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<List<CloudEnvironment>>("/api/saas/environments", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsList", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <returns></returns> + public void EnvironmentsUpdate(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?)) + { + EnvironmentsUpdateWithHttpInfo(cloudEnvironment); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsUpdateWithHttpInfo(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?)) + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = cloudEnvironment; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put<Object>("/api/saas/environments", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsUpdate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsUpdateAsync(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsUpdateWithHttpInfoAsync(cloudEnvironment, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cloudEnvironment"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsUpdateWithHttpInfoAsync(CloudEnvironment? cloudEnvironment = default(CloudEnvironment?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = cloudEnvironment; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync<Object>("/api/saas/environments", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsUpdate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="manifest"> (optional)</param> + /// <param name="appProject"> (optional)</param> + /// <returns></returns> + public void EnvironmentsUpdate_0(string? manifest = default(string?), string? appProject = default(string?)) + { + EnvironmentsUpdate_0WithHttpInfo(manifest, appProject); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="manifest"> (optional)</param> + /// <param name="appProject"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsUpdate_0WithHttpInfo(string? manifest = default(string?), string? appProject = default(string?)) + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (manifest != null) + { + localVarRequestOptions.FormParameters.Add("manifest", VirtoCloud.Client.Client.ClientUtils.ParameterToString(manifest)); // form parameter + } + if (appProject != null) + { + localVarRequestOptions.FormParameters.Add("appProject", VirtoCloud.Client.Client.ClientUtils.ParameterToString(appProject)); // form parameter + } + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put<Object>("/api/saas/environments/update", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsUpdate_0", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="manifest"> (optional)</param> + /// <param name="appProject"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsUpdate_0Async(string? manifest = default(string?), string? appProject = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsUpdate_0WithHttpInfoAsync(manifest, appProject, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="manifest"> (optional)</param> + /// <param name="appProject"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsUpdate_0WithHttpInfoAsync(string? manifest = default(string?), string? appProject = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (manifest != null) + { + localVarRequestOptions.FormParameters.Add("manifest", VirtoCloud.Client.Client.ClientUtils.ParameterToString(manifest)); // form parameter + } + if (appProject != null) + { + localVarRequestOptions.FormParameters.Add("appProject", VirtoCloud.Client.Client.ClientUtils.ParameterToString(appProject)); // form parameter + } + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync<Object>("/api/saas/environments/update", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsUpdate_0", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="environmentNameValidationRequest"> (optional)</param> + /// <returns></returns> + public void EnvironmentsValidateName(EnvironmentNameValidationRequest? environmentNameValidationRequest = default(EnvironmentNameValidationRequest?)) + { + EnvironmentsValidateNameWithHttpInfo(environmentNameValidationRequest); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="environmentNameValidationRequest"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> EnvironmentsValidateNameWithHttpInfo(EnvironmentNameValidationRequest? environmentNameValidationRequest = default(EnvironmentNameValidationRequest?)) + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = environmentNameValidationRequest; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post<Object>("/api/saas/environments/validate-name", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsValidateName", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="environmentNameValidationRequest"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task EnvironmentsValidateNameAsync(EnvironmentNameValidationRequest? environmentNameValidationRequest = default(EnvironmentNameValidationRequest?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await EnvironmentsValidateNameWithHttpInfoAsync(environmentNameValidationRequest, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="environmentNameValidationRequest"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> EnvironmentsValidateNameWithHttpInfoAsync(EnvironmentNameValidationRequest? environmentNameValidationRequest = default(EnvironmentNameValidationRequest?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = environmentNameValidationRequest; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/api/saas/environments/validate-name", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("EnvironmentsValidateName", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns></returns> + public void MetricsGetMetrics(Object? body = default(Object?)) + { + MetricsGetMetricsWithHttpInfo(body); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> MetricsGetMetricsWithHttpInfo(Object? body = default(Object?)) + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = body; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post<Object>("/api/saas/metrics", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("MetricsGetMetrics", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task MetricsGetMetricsAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await MetricsGetMetricsWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> MetricsGetMetricsWithHttpInfoAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = body; + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/api/saas/metrics", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("MetricsGetMetrics", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + public void RssGetNews() + { + RssGetNewsWithHttpInfo(); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> RssGetNewsWithHttpInfo() + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/Rss/news", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RssGetNews", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task RssGetNewsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await RssGetNewsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> RssGetNewsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/Rss/news", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RssGetNews", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns></returns> + public void SystemVersion(Object? body = default(Object?)) + { + SystemVersionWithHttpInfo(body); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> SystemVersionWithHttpInfo(Object? body = default(Object?)) + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = body; + + + // make the HTTP request + var localVarResponse = this.Client.Post<Object>("/api/saas/system/version", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SystemVersion", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task SystemVersionAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await SystemVersionWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="body"> (optional)</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> SystemVersionWithHttpInfoAsync(Object? body = default(Object?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json-patch+json", + "application/json", + "text/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = body; + + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/api/saas/system/version", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SystemVersion", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + public void TemplatesGetClusters() + { + TemplatesGetClustersWithHttpInfo(); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> TemplatesGetClustersWithHttpInfo() + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/templates/clusters", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TemplatesGetClusters", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task TemplatesGetClustersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TemplatesGetClustersWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> TemplatesGetClustersWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/templates/clusters", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TemplatesGetClusters", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <returns></returns> + public void TemplatesGetServicePlan(string name) + { + TemplatesGetServicePlanWithHttpInfo(name); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> TemplatesGetServicePlanWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'name' when calling SaaSDeploymentApi->TemplatesGetServicePlan"); + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("name", VirtoCloud.Client.Client.ClientUtils.ParameterToString(name)); // path parameter + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/templates/service-plan/{name}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TemplatesGetServicePlan", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task TemplatesGetServicePlanAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TemplatesGetServicePlanWithHttpInfoAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="name"></param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> TemplatesGetServicePlanWithHttpInfoAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'name' is set + if (name == null) + throw new VirtoCloud.Client.Client.ApiException(400, "Missing required parameter 'name' when calling SaaSDeploymentApi->TemplatesGetServicePlan"); + + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("name", VirtoCloud.Client.Client.ClientUtils.ParameterToString(name)); // path parameter + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/templates/service-plan/{name}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TemplatesGetServicePlan", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns></returns> + public void TemplatesGetServicePlans() + { + TemplatesGetServicePlansWithHttpInfo(); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <returns>ApiResponse of Object(void)</returns> + public VirtoCloud.Client.Client.ApiResponse<Object> TemplatesGetServicePlansWithHttpInfo() + { + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get<Object>("/api/saas/templates/service-plans", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TemplatesGetServicePlans", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of void</returns> + public async System.Threading.Tasks.Task TemplatesGetServicePlansAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TemplatesGetServicePlansWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + + /// <summary> + /// + /// </summary> + /// <exception cref="VirtoCloud.Client.Client.ApiException">Thrown when fails to make API call</exception> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <returns>Task of ApiResponse</returns> + public async System.Threading.Tasks.Task<VirtoCloud.Client.Client.ApiResponse<Object>> TemplatesGetServicePlansWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + VirtoCloud.Client.Client.RequestOptions localVarRequestOptions = new VirtoCloud.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = VirtoCloud.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = VirtoCloud.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (oauth2) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync<Object>("/api/saas/templates/service-plans", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TemplatesGetServicePlans", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ApiClient.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ApiClient.cs new file mode 100644 index 0000000..720a56e --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ApiClient.cs @@ -0,0 +1,764 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Web; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +using System.Net.Http; +using System.Net.Http.Headers; +using Polly; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// </summary> + internal class CustomJsonCodec + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + 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; + } + + /// <summary> + /// Serialize the object into a JSON string. + /// </summary> + /// <param name="obj">Object to be serialized.</param> + /// <returns>A JSON string.</returns> + public string Serialize(object obj) + { + if (obj != null && obj is VirtoCloud.Client.Model.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((VirtoCloud.Client.Model.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public async Task<T> Deserialize<T>(HttpResponseMessage response) + { + var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); + return result; + } + + /// <summary> + /// Deserialize the JSON string into a proper object. + /// </summary> + /// <param name="response">The HTTP response.</param> + /// <param name="type">Object type.</param> + /// <returns>Object representation of the JSON string.</returns> + internal async Task<object> Deserialize(HttpResponseMessage response, Type type) + { + IList<string> headers = response.Headers.Select(x => x.Key + "=" + x.Value).ToList(); + + if (type == typeof(byte[])) // return byte array + { + return await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); + } + else if (type == typeof(FileParameter)) + { + return new FileParameter(await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); + if (headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? Path.GetTempPath() + : _configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in 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(await response.Content.ReadAsStringAsync().ConfigureAwait(false), null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + /// <summary> + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// </summary> + /// <remarks> + /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. + /// </remarks> + public partial class ApiClient : IDisposable, ISynchronousClient, IAsynchronousClient + { + private readonly string _baseUrl; + + private readonly HttpClientHandler _httpClientHandler; + private readonly HttpClient _httpClient; + private readonly bool _disposeClient; + + /// <summary> + /// Specifies the settings on a <see cref="JsonSerializer" /> object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// </summary> + 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 + } + } + }; + + /// <summary> + /// Initializes a new instance of the <see cref="ApiClient" />, defaulting to the global configurations' base url. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHandler</see>. + /// </summary> + public ApiClient() : + this(VirtoCloud.Client.Client.GlobalConfiguration.Instance.BasePath) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref="ApiClient" />. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHandler</see>. + /// </summary> + /// <param name="basePath">The target service's base path in URL format.</param> + /// <exception cref="ArgumentException"></exception> + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _httpClientHandler = new HttpClientHandler(); + _httpClient = new HttpClient(_httpClientHandler, true); + _disposeClient = true; + _baseUrl = basePath; + } + + /// <summary> + /// Initializes a new instance of the <see cref="ApiClient" />, defaulting to the global configurations' base url. + /// </summary> + /// <param name="client">An instance of HttpClient.</param> + /// <param name="handler">An optional instance of HttpClientHandler that is used by HttpClient.</param> + /// <exception cref="ArgumentNullException"></exception> + /// <remarks> + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// </remarks> + public ApiClient(HttpClient client, HttpClientHandler handler = null) : + this(client, VirtoCloud.Client.Client.GlobalConfiguration.Instance.BasePath, handler) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref="ApiClient" />. + /// </summary> + /// <param name="client">An instance of HttpClient.</param> + /// <param name="basePath">The target service's base path in URL format.</param> + /// <param name="handler">An optional instance of HttpClientHandler that is used by HttpClient.</param> + /// <exception cref="ArgumentNullException"></exception> + /// <exception cref="ArgumentException"></exception> + /// <remarks> + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// </remarks> + public ApiClient(HttpClient client, string basePath, HttpClientHandler handler = null) + { + if (client == null) throw new ArgumentNullException("client cannot be null"); + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _httpClientHandler = handler; + _httpClient = client; + _baseUrl = basePath; + } + + /// <summary> + /// Disposes resources if they were created by us + /// </summary> + public void Dispose() + { + if(_disposeClient) { + _httpClient.Dispose(); + } + } + + /// Prepares multipart/form-data content + HttpContent PrepareMultipartFormDataContent(RequestOptions options) + { + string boundary = "---------" + Guid.NewGuid().ToString().ToUpperInvariant(); + var multipartContent = new MultipartFormDataContent(boundary); + foreach (var formParameter in options.FormParameters) + { + multipartContent.Add(new StringContent(formParameter.Value), formParameter.Key); + } + + if (options.FileParameters != null && options.FileParameters.Count > 0) + { + foreach (var fileParam in options.FileParameters) + { + foreach (var file in fileParam.Value) + { + var content = new StreamContent(file.Content); + content.Headers.ContentType = new MediaTypeHeaderValue(file.ContentType); + multipartContent.Add(content, fileParam.Key, file.Name); + } + } + } + return multipartContent; + } + + /// <summary> + /// Provides all logic for constructing a new HttpRequestMessage. + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the a HttpRequestMessage. + /// </summary> + /// <param name="method">The http verb.</param> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <returns>[private] A new HttpRequestMessage instance.</returns> + /// <exception cref="ArgumentNullException"></exception> + private HttpRequestMessage 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"); + + WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); + + builder.AddPathParameters(options.PathParameters); + + builder.AddQueryParameters(options.QueryParameters); + + HttpRequestMessage request = new HttpRequestMessage(method, builder.GetFullUri()); + + if (configuration.UserAgent != null) + { + request.Headers.TryAddWithoutValidation("User-Agent", configuration.UserAgent); + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.Headers.Add(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + // Todo make content headers actually content headers + request.Headers.TryAddWithoutValidation(headerParam.Key, value); + } + } + } + + List<Tuple<HttpContent, string, string>> contentList = new List<Tuple<HttpContent, string, string>>(); + + string contentType = null; + if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes.FirstOrDefault(); + } + + if (contentType == "multipart/form-data") + { + request.Content = PrepareMultipartFormDataContent(options); + } + else if (contentType == "application/x-www-form-urlencoded") + { + request.Content = new FormUrlEncodedContent(options.FormParameters); + } + else + { + if (options.Data != null) + { + if (options.Data is FileParameter fp) + { + contentType = contentType ?? "application/octet-stream"; + + var streamContent = new StreamContent(fp.Content); + streamContent.Headers.ContentType = new MediaTypeHeaderValue(contentType); + request.Content = streamContent; + } + else + { + var serializer = new CustomJsonCodec(SerializerSettings, configuration); + request.Content = new StringContent(serializer.Serialize(options.Data), new UTF8Encoding(), + "application/json"); + } + } + } + + + + // TODO provide an alternative that allows cookies per request instead of per API client + if (options.Cookies != null && options.Cookies.Count > 0) + { + request.Properties["CookieContainer"] = options.Cookies; + } + + return request; + } + + partial void InterceptRequest(HttpRequestMessage req); + partial void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response); + + private async Task<ApiResponse<T>> ToApiResponse<T>(HttpResponseMessage response, object responseData, Uri uri) + { + T result = (T) responseData; + string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + + var transformed = new ApiResponse<T>(response.StatusCode, new Multimap<string, string>(), result, rawContent) + { + ErrorText = response.ReasonPhrase, + Cookies = new List<Cookie>() + }; + + // process response headers, e.g. Access-Control-Allow-Methods + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + // process response content headers, e.g. Content-Type + if (response.Content.Headers != null) + { + foreach (var responseHeader in response.Content.Headers) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (_httpClientHandler != null && response != null) + { + try { + foreach (Cookie cookie in _httpClientHandler.CookieContainer.GetCookies(uri)) + { + transformed.Cookies.Add(cookie); + } + } + catch (PlatformNotSupportedException) {} + } + + return transformed; + } + + private ApiResponse<T> Exec<T>(HttpRequestMessage req, IReadableConfiguration configuration) + { + return ExecAsync<T>(req, configuration).GetAwaiter().GetResult(); + } + + private async Task<ApiResponse<T>> ExecAsync<T>(HttpRequestMessage req, + IReadableConfiguration configuration, + System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + CancellationTokenSource timeoutTokenSource = null; + CancellationTokenSource finalTokenSource = null; + var deserializer = new CustomJsonCodec(SerializerSettings, configuration); + var finalToken = cancellationToken; + + try + { + if (configuration.Timeout > 0) + { + timeoutTokenSource = new CancellationTokenSource(configuration.Timeout); + finalTokenSource = CancellationTokenSource.CreateLinkedTokenSource(finalToken, timeoutTokenSource.Token); + finalToken = finalTokenSource.Token; + } + + if (configuration.Proxy != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `Proxy` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + _httpClientHandler.Proxy = configuration.Proxy; + } + + if (configuration.ClientCertificates != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + _httpClientHandler.ClientCertificates.AddRange(configuration.ClientCertificates); + } + + var cookieContainer = req.Properties.ContainsKey("CookieContainer") ? req.Properties["CookieContainer"] as List<Cookie> : null; + + if (cookieContainer != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + foreach (var cookie in cookieContainer) + { + _httpClientHandler.CookieContainer.Add(cookie); + } + } + + InterceptRequest(req); + + HttpResponseMessage response; + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy + .ExecuteAndCaptureAsync(() => _httpClient.SendAsync(req, finalToken)) + .ConfigureAwait(false); + response = (policyResult.Outcome == OutcomeType.Successful) ? + policyResult.Result : new HttpResponseMessage() + { + ReasonPhrase = policyResult.FinalException.ToString(), + RequestMessage = req + }; + } + else + { + response = await _httpClient.SendAsync(req, finalToken).ConfigureAwait(false); + } + + if (!response.IsSuccessStatusCode) + { + return await ToApiResponse<T>(response, default(T), req.RequestUri).ConfigureAwait(false); + } + + object responseData = await deserializer.Deserialize<T>(response).ConfigureAwait(false); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(VirtoCloud.Client.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + } + + InterceptResponse(req, response); + + return await ToApiResponse<T>(response, responseData, req.RequestUri).ConfigureAwait(false); + } + catch (OperationCanceledException original) + { + if (timeoutTokenSource != null && timeoutTokenSource.IsCancellationRequested) + { + throw new TaskCanceledException($"[{req.Method}] {req.RequestUri} was timeout.", + new TimeoutException(original.Message, original)); + } + throw; + } + finally + { + if (timeoutTokenSource != null) + { + timeoutTokenSource.Dispose(); + } + + if (finalTokenSource != null) + { + finalTokenSource.Dispose(); + } + } + } + + #region IAsynchronousClient + /// <summary> + /// Make a HTTP GET request (async). + /// </summary> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <param name="cancellationToken">Token that enables callers to cancel the request.</param> + /// <returns>A Task containing ApiResponse</returns> + public Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync<T>(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); + } + + /// <summary> + /// Make a HTTP POST request (async). + /// </summary> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <param name="cancellationToken">Token that enables callers to cancel the request.</param> + /// <returns>A Task containing ApiResponse</returns> + public Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync<T>(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); + } + + /// <summary> + /// Make a HTTP PUT request (async). + /// </summary> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <param name="cancellationToken">Token that enables callers to cancel the request.</param> + /// <returns>A Task containing ApiResponse</returns> + public Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync<T>(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); + } + + /// <summary> + /// Make a HTTP DELETE request (async). + /// </summary> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <param name="cancellationToken">Token that enables callers to cancel the request.</param> + /// <returns>A Task containing ApiResponse</returns> + public Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync<T>(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); + } + + /// <summary> + /// Make a HTTP HEAD request (async). + /// </summary> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <param name="cancellationToken">Token that enables callers to cancel the request.</param> + /// <returns>A Task containing ApiResponse</returns> + public Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync<T>(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); + } + + /// <summary> + /// Make a HTTP OPTION request (async). + /// </summary> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <param name="cancellationToken">Token that enables callers to cancel the request.</param> + /// <returns>A Task containing ApiResponse</returns> + public Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync<T>(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); + } + + /// <summary> + /// Make a HTTP PATCH request (async). + /// </summary> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <param name="cancellationToken">Token that enables callers to cancel the request.</param> + /// <returns>A Task containing ApiResponse</returns> + public Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync<T>(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); + } + #endregion IAsynchronousClient + + #region ISynchronousClient + /// <summary> + /// Make a HTTP GET request (synchronous). + /// </summary> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <returns>A Task containing ApiResponse</returns> + public ApiResponse<T> Get<T>(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec<T>(NewRequest(HttpMethod.Get, path, options, config), config); + } + + /// <summary> + /// Make a HTTP POST request (synchronous). + /// </summary> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <returns>A Task containing ApiResponse</returns> + public ApiResponse<T> Post<T>(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec<T>(NewRequest(HttpMethod.Post, path, options, config), config); + } + + /// <summary> + /// Make a HTTP PUT request (synchronous). + /// </summary> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <returns>A Task containing ApiResponse</returns> + public ApiResponse<T> Put<T>(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec<T>(NewRequest(HttpMethod.Put, path, options, config), config); + } + + /// <summary> + /// Make a HTTP DELETE request (synchronous). + /// </summary> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <returns>A Task containing ApiResponse</returns> + public ApiResponse<T> Delete<T>(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec<T>(NewRequest(HttpMethod.Delete, path, options, config), config); + } + + /// <summary> + /// Make a HTTP HEAD request (synchronous). + /// </summary> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <returns>A Task containing ApiResponse</returns> + public ApiResponse<T> Head<T>(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec<T>(NewRequest(HttpMethod.Head, path, options, config), config); + } + + /// <summary> + /// Make a HTTP OPTION request (synchronous). + /// </summary> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <returns>A Task containing ApiResponse</returns> + public ApiResponse<T> Options<T>(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec<T>(NewRequest(HttpMethod.Options, path, options, config), config); + } + + /// <summary> + /// Make a HTTP PATCH request (synchronous). + /// </summary> + /// <param name="path">The target path (or resource).</param> + /// <param name="options">The additional request options.</param> + /// <param name="configuration">A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method.</param> + /// <returns>A Task containing ApiResponse</returns> + public ApiResponse<T> Patch<T>(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec<T>(NewRequest(new HttpMethod("PATCH"), path, options, config), config); + } + #endregion ISynchronousClient + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ApiException.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ApiException.cs new file mode 100644 index 0000000..ed47d42 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ApiException.cs @@ -0,0 +1,68 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// API Exception + /// </summary> + public class ApiException : Exception + { + /// <summary> + /// Gets or sets the error code (HTTP status code) + /// </summary> + /// <value>The error code (HTTP status code).</value> + public int ErrorCode { get; set; } + + /// <summary> + /// Gets or sets the error content (body json object) + /// </summary> + /// <value>The error content (Http response body).</value> + public object ErrorContent { get; private set; } + + /// <summary> + /// Gets or sets the HTTP headers + /// </summary> + /// <value>HTTP headers</value> + public Multimap<string, string> Headers { get; private set; } + + /// <summary> + /// Initializes a new instance of the <see cref="ApiException"/> class. + /// </summary> + public ApiException() { } + + /// <summary> + /// Initializes a new instance of the <see cref="ApiException"/> class. + /// </summary> + /// <param name="errorCode">HTTP status code.</param> + /// <param name="message">Error message.</param> + public ApiException(int errorCode, string message) : base(message) + { + this.ErrorCode = errorCode; + } + + /// <summary> + /// Initializes a new instance of the <see cref="ApiException"/> class. + /// </summary> + /// <param name="errorCode">HTTP status code.</param> + /// <param name="message">Error message.</param> + /// <param name="errorContent">Error content.</param> + /// <param name="headers">HTTP Headers.</param> + public ApiException(int errorCode, string message, object errorContent = null, Multimap<string, string> headers = null) : base(message) + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + this.Headers = headers; + } + } + +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ApiResponse.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ApiResponse.cs new file mode 100644 index 0000000..f0c5f57 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ApiResponse.cs @@ -0,0 +1,166 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// Provides a non-generic contract for the ApiResponse wrapper. + /// </summary> + public interface IApiResponse + { + /// <summary> + /// The data type of <see cref="Content"/> + /// </summary> + Type ResponseType { get; } + + /// <summary> + /// The content of this response + /// </summary> + Object Content { get; } + + /// <summary> + /// Gets or sets the status code (HTTP status code) + /// </summary> + /// <value>The status code.</value> + HttpStatusCode StatusCode { get; } + + /// <summary> + /// Gets or sets the HTTP headers + /// </summary> + /// <value>HTTP headers</value> + Multimap<string, string> Headers { get; } + + /// <summary> + /// Gets or sets any error text defined by the calling client. + /// </summary> + string ErrorText { get; set; } + + /// <summary> + /// Gets or sets any cookies passed along on the response. + /// </summary> + List<Cookie> Cookies { get; set; } + + /// <summary> + /// The raw content of this response + /// </summary> + string RawContent { get; } + } + + /// <summary> + /// API Response + /// </summary> + public class ApiResponse<T> : IApiResponse + { + #region Properties + + /// <summary> + /// Gets or sets the status code (HTTP status code) + /// </summary> + /// <value>The status code.</value> + public HttpStatusCode StatusCode { get; } + + /// <summary> + /// Gets or sets the HTTP headers + /// </summary> + /// <value>HTTP headers</value> + public Multimap<string, string> Headers { get; } + + /// <summary> + /// Gets or sets the data (parsed HTTP body) + /// </summary> + /// <value>The data.</value> + public T Data { get; } + + /// <summary> + /// Gets or sets any error text defined by the calling client. + /// </summary> + public string ErrorText { get; set; } + + /// <summary> + /// Gets or sets any cookies passed along on the response. + /// </summary> + public List<Cookie> Cookies { get; set; } + + /// <summary> + /// The content of this response + /// </summary> + public Type ResponseType + { + get { return typeof(T); } + } + + /// <summary> + /// The data type of <see cref="Content"/> + /// </summary> + public object Content + { + get { return Data; } + } + + /// <summary> + /// The raw content + /// </summary> + public string RawContent { get; } + + #endregion Properties + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="ApiResponse{T}" /> class. + /// </summary> + /// <param name="statusCode">HTTP status code.</param> + /// <param name="headers">HTTP headers.</param> + /// <param name="data">Data (parsed HTTP body)</param> + /// <param name="rawContent">Raw content.</param> + public ApiResponse(HttpStatusCode statusCode, Multimap<string, string> headers, T data, string rawContent) + { + StatusCode = statusCode; + Headers = headers; + Data = data; + RawContent = rawContent; + } + + /// <summary> + /// Initializes a new instance of the <see cref="ApiResponse{T}" /> class. + /// </summary> + /// <param name="statusCode">HTTP status code.</param> + /// <param name="headers">HTTP headers.</param> + /// <param name="data">Data (parsed HTTP body)</param> + public ApiResponse(HttpStatusCode statusCode, Multimap<string, string> headers, T data) : this(statusCode, headers, data, null) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref="ApiResponse{T}" /> class. + /// </summary> + /// <param name="statusCode">HTTP status code.</param> + /// <param name="data">Data (parsed HTTP body)</param> + /// <param name="rawContent">Raw content.</param> + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref="ApiResponse{T}" /> class. + /// </summary> + /// <param name="statusCode">HTTP status code.</param> + /// <param name="data">Data (parsed HTTP body)</param> + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) + { + } + + #endregion Constructors + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ClientUtils.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ClientUtils.cs new file mode 100644 index 0000000..0693655 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ClientUtils.cs @@ -0,0 +1,247 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// Utility functions providing some benefit to API client consumers. + /// </summary> + public static class ClientUtils + { + /// <summary> + /// Sanitize filename by removing the path + /// </summary> + /// <param name="filename">Filename</param> + /// <returns>Filename</returns> + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// <summary> + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// </summary> + /// <param name="collectionFormat">The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi</param> + /// <param name="name">Key name.</param> + /// <param name="value">Value object.</param> + /// <returns>A multimap of keys with 1..n associated values.</returns> + public static Multimap<string, string> ParameterToMultiMap(string collectionFormat, string name, object value) + { + var parameters = new Multimap<string, string>(); + + 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; + } + + /// <summary> + /// 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. + /// </summary> + /// <param name="obj">The parameter (header, path, query, form).</param> + /// <param name="configuration">An optional configuration instance, providing formatting options used in processing.</param> + /// <returns>Formatted string.</returns> + 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<string> entries = new List<string>(); + 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); + } + + /// <summary> + /// Serializes the given object when not null. Otherwise return null. + /// </summary> + /// <param name="obj">The object to serialize.</param> + /// <returns>Serialized string.</returns> + public static string Serialize(object obj) + { + return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; + } + + /// <summary> + /// Encode string in base64 format. + /// </summary> + /// <param name="text">string to be encoded.</param> + /// <returns>Encoded string.</returns> + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// <summary> + /// Convert stream to byte array + /// </summary> + /// <param name="inputStream">Input stream to be converted</param> + /// <returns>Byte array</returns> + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// <summary> + /// 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' + /// </summary> + /// <param name="contentTypes">The Content-Type array to select from.</param> + /// <returns>The Content-Type header to use.</returns> + 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' + } + + /// <summary> + /// 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) + /// </summary> + /// <param name="accepts">The accepts array to select from.</param> + /// <returns>The Accept header to use.</returns> + 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); + } + + /// <summary> + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// </summary> + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// <summary> + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// </summary> + /// <param name="mime">MIME</param> + /// <returns>Returns True if MIME type is json.</returns> + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// <summary> + /// Is the Enum decorated with EnumMember Attribute + /// </summary> + /// <param name="enumVal"></param> + /// <returns>true if found</returns> + 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<EnumMemberAttribute>().FirstOrDefault(); + if (attr != null) return true; + return false; + } + + /// <summary> + /// Get the EnumMember value + /// </summary> + /// <param name="enumVal"></param> + /// <returns>EnumMember value as string otherwise null</returns> + 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<EnumMemberAttribute>().FirstOrDefault(); + if (attr != null) + { + return attr.Value; + } + return null; + } + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/Configuration.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/Configuration.cs new file mode 100644 index 0000000..3efd731 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/Configuration.cs @@ -0,0 +1,612 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Net.Http; +using System.Net.Security; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// Represents a set of configuration settings + /// </summary> + public class Configuration : IReadableConfiguration + { + #region Constants + + /// <summary> + /// Version of the package. + /// </summary> + /// <value>Version of the package.</value> + public const string Version = "1.0.0"; + + /// <summary> + /// Identifier for ISO 8601 DateTime Format + /// </summary> + /// <remarks>See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information.</remarks> + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// <summary> + /// Default creation of exceptions for a given method name and response object + /// </summary> + 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 + + /// <summary> + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// </summary> + private string _basePath; + + private bool _useDefaultCredentials = false; + + /// <summary> + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for accessing an API. + /// </summary> + /// <value>The API key.</value> + private IDictionary<string, string> _apiKey; + + /// <summary> + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// </summary> + /// <value>The prefix of the API key.</value> + private IDictionary<string, string> _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + + /// <summary> + /// Gets or sets the servers defined in the OpenAPI spec. + /// </summary> + /// <value>The servers</value> + private IList<IReadOnlyDictionary<string, object>> _servers; + + /// <summary> + /// Gets or sets the operation servers defined in the OpenAPI spec. + /// </summary> + /// <value>The operation servers</value> + private IReadOnlyDictionary<string, List<IReadOnlyDictionary<string, object>>> _operationServers; + + #endregion Private Members + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="Configuration" /> class + /// </summary> + [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<string, string>(); + ApiKey = new ConcurrentDictionary<string, string>(); + ApiKeyPrefix = new ConcurrentDictionary<string, string>(); + Servers = new List<IReadOnlyDictionary<string, object>>() + { + { + new Dictionary<string, object> { + {"url", ""}, + {"description", "No description provided"}, + } + } + }; + OperationServers = new Dictionary<string, List<IReadOnlyDictionary<string, object>>>() + { + }; + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = 100000; + } + + /// <summary> + /// Initializes a new instance of the <see cref="Configuration" /> class + /// </summary> + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary<string, string> defaultHeaders, + IDictionary<string, string> apiKey, + IDictionary<string, string> 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 + + /// <summary> + /// Gets or sets the base path for API access. + /// </summary> + public virtual string BasePath + { + get { return _basePath; } + set { _basePath = value; } + } + + /// <summary> + /// 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. + /// </summary> + public virtual bool UseDefaultCredentials + { + get { return _useDefaultCredentials; } + set { _useDefaultCredentials = value; } + } + + /// <summary> + /// Gets or sets the default header. + /// </summary> + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary<string, string> DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// <summary> + /// Gets or sets the default headers. + /// </summary> + public virtual IDictionary<string, string> DefaultHeaders { get; set; } + + /// <summary> + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// </summary> + public virtual int Timeout { get; set; } + + /// <summary> + /// Gets or sets the proxy + /// </summary> + /// <value>Proxy.</value> + public virtual WebProxy Proxy { get; set; } + + /// <summary> + /// Gets or sets the HTTP user agent. + /// </summary> + /// <value>Http user agent.</value> + public virtual string UserAgent { get; set; } + + /// <summary> + /// Gets or sets the username (HTTP basic authentication). + /// </summary> + /// <value>The username.</value> + public virtual string Username { get; set; } + + /// <summary> + /// Gets or sets the password (HTTP basic authentication). + /// </summary> + /// <value>The password.</value> + public virtual string Password { get; set; } + + /// <summary> + /// Gets the API key with prefix. + /// </summary> + /// <param name="apiKeyIdentifier">API key identifier (authentication scheme).</param> + /// <returns>API key with prefix.</returns> + 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; + } + + /// <summary> + /// Gets or sets certificate collection to be sent with requests. + /// </summary> + /// <value>X509 Certificate collection.</value> + public X509CertificateCollection ClientCertificates { get; set; } + + /// <summary> + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// </summary> + /// <value>The access token.</value> + public virtual string AccessToken { get; set; } + + /// <summary> + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// </summary> + /// <value>Folder path.</value> + 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; + } + } + } + + /// <summary> + /// 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 + /// </summary> + /// <value>The DateTimeFormat string</value> + 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; + } + } + + /// <summary> + /// 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: + /// <example> + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// </example> + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// <remarks> + /// OAuth2 workflows should set tokens via AccessToken. + /// </remarks> + /// </summary> + /// <value>The prefix of the API key.</value> + public virtual IDictionary<string, string> ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// <summary> + /// Gets or sets the API key based on the authentication name. + /// </summary> + /// <value>The API key.</value> + public virtual IDictionary<string, string> ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + + /// <summary> + /// Gets or sets the servers. + /// </summary> + /// <value>The servers.</value> + public virtual IList<IReadOnlyDictionary<string, object>> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// <summary> + /// Gets or sets the operation servers. + /// </summary> + /// <value>The operation servers.</value> + public virtual IReadOnlyDictionary<string, List<IReadOnlyDictionary<string, object>>> OperationServers + { + get { return _operationServers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Operation servers may not be null."); + } + _operationServers = value; + } + } + + /// <summary> + /// Returns URL based on server settings without providing values + /// for the variables + /// </summary> + /// <param name="index">Array index of the server settings.</param> + /// <return>The server URL.</return> + public string GetServerUrl(int index) + { + return GetServerUrl(Servers, index, null); + } + + /// <summary> + /// Returns URL based on server settings. + /// </summary> + /// <param name="index">Array index of the server settings.</param> + /// <param name="inputVariables">Dictionary of the variables and the corresponding values.</param> + /// <return>The server URL.</return> + public string GetServerUrl(int index, Dictionary<string, string> inputVariables) + { + return GetServerUrl(Servers, index, inputVariables); + } + + /// <summary> + /// Returns URL based on operation server settings. + /// </summary> + /// <param name="operation">Operation associated with the request path.</param> + /// <param name="index">Array index of the server settings.</param> + /// <return>The operation server URL.</return> + public string GetOperationServerUrl(string operation, int index) + { + return GetOperationServerUrl(operation, index, null); + } + + /// <summary> + /// Returns URL based on operation server settings. + /// </summary> + /// <param name="operation">Operation associated with the request path.</param> + /// <param name="index">Array index of the server settings.</param> + /// <param name="inputVariables">Dictionary of the variables and the corresponding values.</param> + /// <return>The operation server URL.</return> + public string GetOperationServerUrl(string operation, int index, Dictionary<string, string> inputVariables) + { + if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) + { + return GetServerUrl(operationServer, index, inputVariables); + } + + return null; + } + + /// <summary> + /// Returns URL based on server settings. + /// </summary> + /// <param name="servers">Dictionary of server settings.</param> + /// <param name="index">Array index of the server settings.</param> + /// <param name="inputVariables">Dictionary of the variables and the corresponding values.</param> + /// <return>The server URL.</return> + private string GetServerUrl(IList<IReadOnlyDictionary<string, object>> servers, int index, Dictionary<string, string> 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<string, string>(); + } + + IReadOnlyDictionary<string, object> server = servers[index]; + string url = (string)server["url"]; + + if (server.ContainsKey("variables")) + { + // go through each variable and assign a value + foreach (KeyValuePair<string, object> variable in (IReadOnlyDictionary<string, object>)server["variables"]) + { + + IReadOnlyDictionary<string, object> serverVariables = (IReadOnlyDictionary<string, object>)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (((List<string>)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<string>)serverVariables["enum_values"]}"); + } + } + else + { + // use default value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + } + + return url; + } + + /// <summary> + /// Gets and Sets the RemoteCertificateValidationCallback + /// </summary> + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } + + #endregion Properties + + #region Methods + + /// <summary> + /// Returns a string with essential information for debugging. + /// </summary> + public static string ToDebugReport() + { + string report = "C# SDK (VirtoCloud.Client) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: v1\n"; + report += " SDK Package Version: 1.0.0\n"; + + return report; + } + + /// <summary> + /// Add Api Key Header. + /// </summary> + /// <param name="key">Api Key name.</param> + /// <param name="value">Api Key value.</param> + /// <returns></returns> + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// <summary> + /// Sets the API key prefix. + /// </summary> + /// <param name="key">Api Key name.</param> + /// <param name="value">Api Key value.</param> + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// <summary> + /// Merge configurations. + /// </summary> + /// <param name="first">First configuration.</param> + /// <param name="second">Second configuration.</param> + /// <return>Merged configuration.</return> + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary<string, string> apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary<string, string> apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary<string, string> 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/Virtocloud.Client/src/VirtoCloud.Client/Client/ExceptionFactory.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ExceptionFactory.cs new file mode 100644 index 0000000..aa32a5a --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ExceptionFactory.cs @@ -0,0 +1,22 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// A delegate to ExceptionFactory method + /// </summary> + /// <param name="methodName">Method name</param> + /// <param name="response">Response</param> + /// <returns>Exceptions</returns> + public delegate Exception ExceptionFactory(string methodName, IApiResponse response); +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/FileParameter.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/FileParameter.cs new file mode 100644 index 0000000..19d88ab --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/FileParameter.cs @@ -0,0 +1,80 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System.IO; + +namespace VirtoCloud.Client.Client +{ + + /// <summary> + /// Represents a File passed to the API as a Parameter, allows using different backends for files + /// </summary> + public class FileParameter + { + /// <summary> + /// The filename + /// </summary> + public string Name { get; set; } = "no_name_provided"; + + /// <summary> + /// The content type of the file + /// </summary> + public string ContentType { get; set; } = "application/octet-stream"; + + /// <summary> + /// The content of the file + /// </summary> + public Stream Content { get; set; } + + /// <summary> + /// Construct a FileParameter just from the contents, will extract the filename from a filestream + /// </summary> + /// <param name="content"> The file content </param> + public FileParameter(Stream content) + { + if (content is FileStream fs) + { + Name = fs.Name; + } + Content = content; + } + + /// <summary> + /// Construct a FileParameter from name and content + /// </summary> + /// <param name="filename">The filename</param> + /// <param name="content">The file content</param> + public FileParameter(string filename, Stream content) + { + Name = filename; + Content = content; + } + + /// <summary> + /// Construct a FileParameter from name and content + /// </summary> + /// <param name="filename">The filename</param> + /// <param name="contentType">The content type of the file</param> + /// <param name="content">The file content</param> + public FileParameter(string filename, string contentType, Stream content) + { + Name = filename; + ContentType = contentType; + Content = content; + } + + /// <summary> + /// Implicit conversion of stream to file parameter. Useful for backwards compatibility. + /// </summary> + /// <param name="s">Stream to convert</param> + /// <returns>FileParameter</returns> + public static implicit operator FileParameter(Stream s) => new FileParameter(s); + } +} \ No newline at end of file diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/GlobalConfiguration.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/GlobalConfiguration.cs new file mode 100644 index 0000000..8aa27c8 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/GlobalConfiguration.cs @@ -0,0 +1,67 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System.Collections.Generic; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// <see cref="GlobalConfiguration"/> provides a compile-time extension point for globally configuring + /// API Clients. + /// </summary> + /// <remarks> + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .openapi-generator-ignore file. + /// </remarks> + public partial class GlobalConfiguration : Configuration + { + #region Private Members + + private static readonly object GlobalConfigSync = new { }; + private static IReadableConfiguration _globalConfiguration; + + #endregion Private Members + + #region Constructors + + /// <inheritdoc /> + private GlobalConfiguration() + { + } + + /// <inheritdoc /> + public GlobalConfiguration(IDictionary<string, string> defaultHeader, IDictionary<string, string> apiKey, IDictionary<string, string> apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) + { + } + + static GlobalConfiguration() + { + Instance = new GlobalConfiguration(); + } + + #endregion Constructors + + /// <summary> + /// Gets or sets the default Configuration. + /// </summary> + /// <value>Configuration.</value> + public static IReadableConfiguration Instance + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/IApiAccessor.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/IApiAccessor.cs new file mode 100644 index 0000000..2aa35b5 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/IApiAccessor.cs @@ -0,0 +1,37 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// Represents configuration aspects required to interact with the API endpoints. + /// </summary> + public interface IApiAccessor + { + /// <summary> + /// Gets or sets the configuration object + /// </summary> + /// <value>An instance of the Configuration</value> + IReadableConfiguration Configuration { get; set; } + + /// <summary> + /// Gets the base path of the API client. + /// </summary> + /// <value>The base path</value> + string GetBasePath(); + + /// <summary> + /// Provides a factory method hook for the creation of exceptions. + /// </summary> + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/IAsynchronousClient.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/IAsynchronousClient.cs new file mode 100644 index 0000000..7eba5a8 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/IAsynchronousClient.cs @@ -0,0 +1,100 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Threading.Tasks; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// Contract for Asynchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// </summary> + public interface IAsynchronousClient + { + /// <summary> + /// Executes a non-blocking call to some <paramref name="path"/> using the GET http verb. + /// </summary> + /// <param name="path">The relative path to invoke.</param> + /// <param name="options">The request parameters to pass along to the client.</param> + /// <param name="configuration">Per-request configurable settings.</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <typeparam name="T">The return type.</typeparam> + /// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns> + Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// Executes a non-blocking call to some <paramref name="path"/> using the POST http verb. + /// </summary> + /// <param name="path">The relative path to invoke.</param> + /// <param name="options">The request parameters to pass along to the client.</param> + /// <param name="configuration">Per-request configurable settings.</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <typeparam name="T">The return type.</typeparam> + /// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns> + Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// Executes a non-blocking call to some <paramref name="path"/> using the PUT http verb. + /// </summary> + /// <param name="path">The relative path to invoke.</param> + /// <param name="options">The request parameters to pass along to the client.</param> + /// <param name="configuration">Per-request configurable settings.</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <typeparam name="T">The return type.</typeparam> + /// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns> + Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// Executes a non-blocking call to some <paramref name="path"/> using the DELETE http verb. + /// </summary> + /// <param name="path">The relative path to invoke.</param> + /// <param name="options">The request parameters to pass along to the client.</param> + /// <param name="configuration">Per-request configurable settings.</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <typeparam name="T">The return type.</typeparam> + /// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns> + Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// Executes a non-blocking call to some <paramref name="path"/> using the HEAD http verb. + /// </summary> + /// <param name="path">The relative path to invoke.</param> + /// <param name="options">The request parameters to pass along to the client.</param> + /// <param name="configuration">Per-request configurable settings.</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <typeparam name="T">The return type.</typeparam> + /// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns> + Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// Executes a non-blocking call to some <paramref name="path"/> using the OPTIONS http verb. + /// </summary> + /// <param name="path">The relative path to invoke.</param> + /// <param name="options">The request parameters to pass along to the client.</param> + /// <param name="configuration">Per-request configurable settings.</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <typeparam name="T">The return type.</typeparam> + /// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns> + Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// <summary> + /// Executes a non-blocking call to some <paramref name="path"/> using the PATCH http verb. + /// </summary> + /// <param name="path">The relative path to invoke.</param> + /// <param name="options">The request parameters to pass along to the client.</param> + /// <param name="configuration">Per-request configurable settings.</param> + /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> + /// <typeparam name="T">The return type.</typeparam> + /// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns> + Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/IReadableConfiguration.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/IReadableConfiguration.cs new file mode 100644 index 0000000..c42e79e --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/IReadableConfiguration.cs @@ -0,0 +1,141 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// Represents a readable-only configuration contract. + /// </summary> + public interface IReadableConfiguration + { + /// <summary> + /// Gets the access token. + /// </summary> + /// <value>Access token.</value> + string AccessToken { get; } + + /// <summary> + /// Gets the API key. + /// </summary> + /// <value>API key.</value> + IDictionary<string, string> ApiKey { get; } + + /// <summary> + /// Gets the API key prefix. + /// </summary> + /// <value>API key prefix.</value> + IDictionary<string, string> ApiKeyPrefix { get; } + + /// <summary> + /// Gets the base path. + /// </summary> + /// <value>Base path.</value> + string BasePath { get; } + + /// <summary> + /// Gets the date time format. + /// </summary> + /// <value>Date time format.</value> + string DateTimeFormat { get; } + + /// <summary> + /// Gets the default header. + /// </summary> + /// <value>Default header.</value> + [Obsolete("Use DefaultHeaders instead.")] + IDictionary<string, string> DefaultHeader { get; } + + /// <summary> + /// Gets the default headers. + /// </summary> + /// <value>Default headers.</value> + IDictionary<string, string> DefaultHeaders { get; } + + /// <summary> + /// Gets the temp folder path. + /// </summary> + /// <value>Temp folder path.</value> + string TempFolderPath { get; } + + /// <summary> + /// Gets the HTTP connection timeout (in milliseconds) + /// </summary> + /// <value>HTTP connection timeout.</value> + int Timeout { get; } + + /// <summary> + /// Gets the proxy. + /// </summary> + /// <value>Proxy.</value> + WebProxy Proxy { get; } + + /// <summary> + /// Gets the user agent. + /// </summary> + /// <value>User agent.</value> + string UserAgent { get; } + + /// <summary> + /// Gets the username. + /// </summary> + /// <value>Username.</value> + string Username { get; } + + /// <summary> + /// Gets the password. + /// </summary> + /// <value>Password.</value> + string Password { get; } + + /// <summary> + /// 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. + /// </summary> + bool UseDefaultCredentials { get; } + + /// <summary> + /// Get the servers associated with the operation. + /// </summary> + /// <value>Operation servers.</value> + IReadOnlyDictionary<string, List<IReadOnlyDictionary<string, object>>> OperationServers { get; } + + /// <summary> + /// Gets the API key with prefix. + /// </summary> + /// <param name="apiKeyIdentifier">API key identifier (authentication scheme).</param> + /// <returns>API key with prefix.</returns> + string GetApiKeyWithPrefix(string apiKeyIdentifier); + + /// <summary> + /// Gets the Operation server url at the provided index. + /// </summary> + /// <param name="operation">Operation server name.</param> + /// <param name="index">Index of the operation server settings.</param> + /// <returns></returns> + string GetOperationServerUrl(string operation, int index); + + /// <summary> + /// Gets certificate collection to be sent with requests. + /// </summary> + /// <value>X509 Certificate collection.</value> + X509CertificateCollection ClientCertificates { get; } + + /// <summary> + /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and + /// overriding certificate errors in the scope of a request. + /// </summary> + RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ISynchronousClient.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ISynchronousClient.cs new file mode 100644 index 0000000..96328c8 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/ISynchronousClient.cs @@ -0,0 +1,93 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.IO; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// Contract for Synchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// </summary> + public interface ISynchronousClient + { + /// <summary> + /// Executes a blocking call to some <paramref name="path"/> using the GET http verb. + /// </summary> + /// <param name="path">The relative path to invoke.</param> + /// <param name="options">The request parameters to pass along to the client.</param> + /// <param name="configuration">Per-request configurable settings.</param> + /// <typeparam name="T">The return type.</typeparam> + /// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns> + ApiResponse<T> Get<T>(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// <summary> + /// Executes a blocking call to some <paramref name="path"/> using the POST http verb. + /// </summary> + /// <param name="path">The relative path to invoke.</param> + /// <param name="options">The request parameters to pass along to the client.</param> + /// <param name="configuration">Per-request configurable settings.</param> + /// <typeparam name="T">The return type.</typeparam> + /// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns> + ApiResponse<T> Post<T>(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// <summary> + /// Executes a blocking call to some <paramref name="path"/> using the PUT http verb. + /// </summary> + /// <param name="path">The relative path to invoke.</param> + /// <param name="options">The request parameters to pass along to the client.</param> + /// <param name="configuration">Per-request configurable settings.</param> + /// <typeparam name="T">The return type.</typeparam> + /// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns> + ApiResponse<T> Put<T>(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// <summary> + /// Executes a blocking call to some <paramref name="path"/> using the DELETE http verb. + /// </summary> + /// <param name="path">The relative path to invoke.</param> + /// <param name="options">The request parameters to pass along to the client.</param> + /// <param name="configuration">Per-request configurable settings.</param> + /// <typeparam name="T">The return type.</typeparam> + /// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns> + ApiResponse<T> Delete<T>(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// <summary> + /// Executes a blocking call to some <paramref name="path"/> using the HEAD http verb. + /// </summary> + /// <param name="path">The relative path to invoke.</param> + /// <param name="options">The request parameters to pass along to the client.</param> + /// <param name="configuration">Per-request configurable settings.</param> + /// <typeparam name="T">The return type.</typeparam> + /// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns> + ApiResponse<T> Head<T>(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// <summary> + /// Executes a blocking call to some <paramref name="path"/> using the OPTIONS http verb. + /// </summary> + /// <param name="path">The relative path to invoke.</param> + /// <param name="options">The request parameters to pass along to the client.</param> + /// <param name="configuration">Per-request configurable settings.</param> + /// <typeparam name="T">The return type.</typeparam> + /// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns> + ApiResponse<T> Options<T>(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// <summary> + /// Executes a blocking call to some <paramref name="path"/> using the PATCH http verb. + /// </summary> + /// <param name="path">The relative path to invoke.</param> + /// <param name="options">The request parameters to pass along to the client.</param> + /// <param name="configuration">Per-request configurable settings.</param> + /// <typeparam name="T">The return type.</typeparam> + /// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns> + ApiResponse<T> Patch<T>(string path, RequestOptions options, IReadableConfiguration configuration = null); + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/Multimap.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/Multimap.cs new file mode 100644 index 0000000..cb1ca79 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/Multimap.cs @@ -0,0 +1,295 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// A dictionary in which one key has many associated values. + /// </summary> + /// <typeparam name="TKey">The type of the key</typeparam> + /// <typeparam name="TValue">The type of the value associated with the key.</typeparam> + public class Multimap<TKey, TValue> : IDictionary<TKey, IList<TValue>> + { + #region Private Fields + + private readonly Dictionary<TKey, IList<TValue>> _dictionary; + + #endregion Private Fields + + #region Constructors + + /// <summary> + /// Empty Constructor. + /// </summary> + public Multimap() + { + _dictionary = new Dictionary<TKey, IList<TValue>>(); + } + + /// <summary> + /// Constructor with comparer. + /// </summary> + /// <param name="comparer"></param> + public Multimap(IEqualityComparer<TKey> comparer) + { + _dictionary = new Dictionary<TKey, IList<TValue>>(comparer); + } + + #endregion Constructors + + #region Enumerators + + /// <summary> + /// To get the enumerator. + /// </summary> + /// <returns>Enumerator</returns> + public IEnumerator<KeyValuePair<TKey, IList<TValue>>> GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + /// <summary> + /// To get the enumerator. + /// </summary> + /// <returns>Enumerator</returns> + IEnumerator IEnumerable.GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + #endregion Enumerators + + #region Public Members + /// <summary> + /// Add values to Multimap + /// </summary> + /// <param name="item">Key value pair</param> + public void Add(KeyValuePair<TKey, IList<TValue>> item) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + + /// <summary> + /// Add Multimap to Multimap + /// </summary> + /// <param name="multimap">Multimap</param> + public void Add(Multimap<TKey, TValue> multimap) + { + foreach (var item in multimap) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + + /// <summary> + /// Clear Multimap + /// </summary> + public void Clear() + { + _dictionary.Clear(); + } + + /// <summary> + /// Determines whether Multimap contains the specified item. + /// </summary> + /// <param name="item">Key value pair</param> + /// <exception cref="NotImplementedException">Method needs to be implemented</exception> + /// <returns>true if the Multimap contains the item; otherwise, false.</returns> + public bool Contains(KeyValuePair<TKey, IList<TValue>> item) + { + throw new NotImplementedException(); + } + + /// <summary> + /// Copy items of the Multimap to an array, + /// starting at a particular array index. + /// </summary> + /// <param name="array">The array that is the destination of the items copied + /// from Multimap. The array must have zero-based indexing.</param> + /// <param name="arrayIndex">The zero-based index in array at which copying begins.</param> + /// <exception cref="NotImplementedException">Method needs to be implemented</exception> + public void CopyTo(KeyValuePair<TKey, IList<TValue>>[] array, int arrayIndex) + { + throw new NotImplementedException(); + } + + /// <summary> + /// Removes the specified item from the Multimap. + /// </summary> + /// <param name="item">Key value pair</param> + /// <returns>true if the item is successfully removed; otherwise, false.</returns> + /// <exception cref="NotImplementedException">Method needs to be implemented</exception> + public bool Remove(KeyValuePair<TKey, IList<TValue>> item) + { + throw new NotImplementedException(); + } + + /// <summary> + /// Gets the number of items contained in the Multimap. + /// </summary> + public int Count => _dictionary.Count; + + /// <summary> + /// Gets a value indicating whether the Multimap is read-only. + /// </summary> + public bool IsReadOnly => false; + + /// <summary> + /// Adds an item with the provided key and value to the Multimap. + /// </summary> + /// <param name="key">The object to use as the key of the item to add.</param> + /// <param name="value">The object to use as the value of the item to add.</param> + /// <exception cref="InvalidOperationException">Thrown when couldn't add the value to Multimap.</exception> + public void Add(TKey key, IList<TValue> 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<TValue>(value); + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + } + + /// <summary> + /// Determines whether the Multimap contains an item with the specified key. + /// </summary> + /// <param name="key">The key to locate in the Multimap.</param> + /// <returns>true if the Multimap contains an item with + /// the key; otherwise, false.</returns> + public bool ContainsKey(TKey key) + { + return _dictionary.ContainsKey(key); + } + + /// <summary> + /// Removes item with the specified key from the Multimap. + /// </summary> + /// <param name="key">The key to locate in the Multimap.</param> + /// <returns>true if the item is successfully removed; otherwise, false.</returns> + public bool Remove(TKey key) + { + return TryRemove(key, out var _); + } + + /// <summary> + /// Gets the value associated with the specified key. + /// </summary> + /// <param name="key">The key whose value to get.</param> + /// <param name="value">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.</param> + /// <returns> true if the object that implements Multimap contains + /// an item with the specified key; otherwise, false.</returns> + public bool TryGetValue(TKey key, out IList<TValue> value) + { + return _dictionary.TryGetValue(key, out value); + } + + /// <summary> + /// Gets or sets the item with the specified key. + /// </summary> + /// <param name="key">The key of the item to get or set.</param> + /// <returns>The value of the specified key.</returns> + public IList<TValue> this[TKey key] + { + get => _dictionary[key]; + set => _dictionary[key] = value; + } + + /// <summary> + /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. + /// </summary> + public ICollection<TKey> Keys => _dictionary.Keys; + + /// <summary> + /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. + /// </summary> + public ICollection<IList<TValue>> Values => _dictionary.Values; + + /// <summary> + /// Copy the items of the Multimap to an System.Array, + /// starting at a particular System.Array index. + /// </summary> + /// <param name="array">The one-dimensional System.Array that is the destination of the items copied + /// from Multimap. The System.Array must have zero-based indexing.</param> + /// <param name="index">The zero-based index in array at which copying begins.</param> + public void CopyTo(Array array, int index) + { + ((ICollection)_dictionary).CopyTo(array, index); + } + + /// <summary> + /// Adds an item with the provided key and value to the Multimap. + /// </summary> + /// <param name="key">The object to use as the key of the item to add.</param> + /// <param name="value">The object to use as the value of the item to add.</param> + /// <exception cref="InvalidOperationException">Thrown when couldn't add value to Multimap.</exception> + public void Add(TKey key, TValue value) + { + if (value != null) + { + if (_dictionary.TryGetValue(key, out var list)) + { + list.Add(value); + } + else + { + list = new List<TValue> { 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<TValue> 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<TValue> value) + { + try + { + _dictionary.Add(key, value); + } + catch (ArgumentException) + { + return false; + } + + return true; + } + #endregion Private Members + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/OpenAPIDateConverter.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/OpenAPIDateConverter.cs new file mode 100644 index 0000000..7027f95 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/OpenAPIDateConverter.cs @@ -0,0 +1,29 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using Newtonsoft.Json.Converters; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// 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 + /// </summary> + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// <summary> + /// Initializes a new instance of the <see cref="OpenAPIDateConverter" /> class. + /// </summary> + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/RequestOptions.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/RequestOptions.cs new file mode 100644 index 0000000..da90cca --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/RequestOptions.cs @@ -0,0 +1,74 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// 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). + /// </summary> + public class RequestOptions + { + /// <summary> + /// Parameters to be bound to path parts of the Request's URL + /// </summary> + public Dictionary<string, string> PathParameters { get; set; } + + /// <summary> + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// </summary> + public Multimap<string, string> QueryParameters { get; set; } + + /// <summary> + /// Header parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// </summary> + public Multimap<string, string> HeaderParameters { get; set; } + + /// <summary> + /// Form parameters to be sent along with the request. + /// </summary> + public Dictionary<string, string> FormParameters { get; set; } + + /// <summary> + /// File parameters to be sent along with the request. + /// </summary> + public Multimap<string, FileParameter> FileParameters { get; set; } + + /// <summary> + /// Cookies to be sent along with the request. + /// </summary> + public List<Cookie> Cookies { get; set; } + + /// <summary> + /// Any data associated with a request body. + /// </summary> + public Object Data { get; set; } + + /// <summary> + /// Constructs a new instance of <see cref="RequestOptions"/> + /// </summary> + public RequestOptions() + { + PathParameters = new Dictionary<string, string>(); + QueryParameters = new Multimap<string, string>(); + HeaderParameters = new Multimap<string, string>(); + FormParameters = new Dictionary<string, string>(); + FileParameters = new Multimap<string, FileParameter>(); + Cookies = new List<Cookie>(); + } + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/RetryConfiguration.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/RetryConfiguration.cs new file mode 100644 index 0000000..40e6293 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/RetryConfiguration.cs @@ -0,0 +1,31 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Polly; +using System.Net.Http; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// Configuration class to set the polly retry policies to be applied to the requests. + /// </summary> + public static class RetryConfiguration + { + /// <summary> + /// Retry policy + /// </summary> + public static Policy<HttpResponseMessage> RetryPolicy { get; set; } + + /// <summary> + /// Async retry policy + /// </summary> + public static AsyncPolicy<HttpResponseMessage> AsyncRetryPolicy { get; set; } + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Client/WebRequestPathBuilder.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/WebRequestPathBuilder.cs new file mode 100644 index 0000000..9edcb4c --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Client/WebRequestPathBuilder.cs @@ -0,0 +1,53 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; + +namespace VirtoCloud.Client.Client +{ + /// <summary> + /// A URI builder + /// </summary> + class WebRequestPathBuilder + { + private string _baseUrl; + private string _path; + private string _query = "?"; + public WebRequestPathBuilder(string baseUrl, string path) + { + _baseUrl = baseUrl; + _path = path; + } + + public void AddPathParameters(Dictionary<string, string> parameters) + { + foreach (var parameter in parameters) + { + _path = _path.Replace("{" + parameter.Key + "}", Uri.EscapeDataString(parameter.Value)); + } + } + + public void AddQueryParameters(Multimap<string, string> parameters) + { + foreach (var parameter in parameters) + { + foreach (var value in parameter.Value) + { + _query = _query + parameter.Key + "=" + Uri.EscapeDataString(value) + "&"; + } + } + } + + public string GetFullUri() + { + return _baseUrl + _path + _query.Substring(0, _query.Length - 1); + } + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Model/AbstractOpenAPISchema.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Model/AbstractOpenAPISchema.cs new file mode 100644 index 0000000..cea5da8 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Model/AbstractOpenAPISchema.cs @@ -0,0 +1,76 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace VirtoCloud.Client.Model +{ + /// <summary> + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// </summary> + public abstract partial class AbstractOpenAPISchema + { + /// <summary> + /// Custom JSON serializer + /// </summary> + 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 + } + } + }; + + /// <summary> + /// Custom JSON serializer for objects with additional properties + /// </summary> + 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 + } + } + }; + + /// <summary> + /// Gets or Sets the actual instance + /// </summary> + public abstract Object ActualInstance { get; set; } + + /// <summary> + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// </summary> + public bool IsNullable { get; protected set; } + + /// <summary> + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// </summary> + public string SchemaType { get; protected set; } + + /// <summary> + /// Converts the instance into JSON string. + /// </summary> + public abstract string ToJson(); + } +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Model/CloudEnvironment.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Model/CloudEnvironment.cs new file mode 100644 index 0000000..6485961 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Model/CloudEnvironment.cs @@ -0,0 +1,329 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = VirtoCloud.Client.Client.FileParameter; +using OpenAPIDateConverter = VirtoCloud.Client.Client.OpenAPIDateConverter; + +namespace VirtoCloud.Client.Model +{ + /// <summary> + /// CloudEnvironment + /// </summary> + [DataContract(Name = "CloudEnvironment")] + public partial class CloudEnvironment : IEquatable<CloudEnvironment>, IValidatableObject + { + /// <summary> + /// Initializes a new instance of the <see cref="CloudEnvironment" /> class. + /// </summary> + /// <param name="labels">labels.</param> + /// <param name="appProjectId">appProjectId.</param> + /// <param name="metadataName">metadataName.</param> + /// <param name="tenantId">tenantId.</param> + /// <param name="id">id.</param> + /// <param name="name">name.</param> + /// <param name="status">status.</param> + /// <param name="syncStatus">syncStatus.</param> + /// <param name="created">created.</param> + /// <param name="updated">updated.</param> + /// <param name="urls">urls.</param> + /// <param name="helm">helm.</param> + public CloudEnvironment(Dictionary<string, string> labels = default(Dictionary<string, string>), string appProjectId = default(string), string metadataName = default(string), string tenantId = default(string), string id = default(string), string name = default(string), string status = default(string), string syncStatus = default(string), DateTime created = default(DateTime), DateTime updated = default(DateTime), List<string> urls = default(List<string>), Helm helm = default(Helm)) + { + this.Labels = labels; + this.AppProjectId = appProjectId; + this.MetadataName = metadataName; + this.TenantId = tenantId; + this.Id = id; + this.Name = name; + this.Status = status; + this.SyncStatus = syncStatus; + this.Created = created; + this.Updated = updated; + this.Urls = urls; + this.Helm = helm; + } + + /// <summary> + /// Gets or Sets Labels + /// </summary> + [DataMember(Name = "labels", EmitDefaultValue = true)] + public Dictionary<string, string> Labels { get; set; } + + /// <summary> + /// Gets or Sets AppProjectId + /// </summary> + [DataMember(Name = "appProjectId", EmitDefaultValue = true)] + public string AppProjectId { get; set; } + + /// <summary> + /// Gets or Sets MetadataName + /// </summary> + [DataMember(Name = "metadataName", EmitDefaultValue = true)] + public string MetadataName { get; set; } + + /// <summary> + /// Gets or Sets TenantId + /// </summary> + [DataMember(Name = "tenantId", EmitDefaultValue = true)] + public string TenantId { get; set; } + + /// <summary> + /// Gets or Sets Id + /// </summary> + [DataMember(Name = "id", EmitDefaultValue = true)] + public string Id { get; set; } + + /// <summary> + /// Gets or Sets Name + /// </summary> + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// <summary> + /// Gets or Sets Status + /// </summary> + [DataMember(Name = "status", EmitDefaultValue = true)] + public string Status { get; set; } + + /// <summary> + /// Gets or Sets SyncStatus + /// </summary> + [DataMember(Name = "syncStatus", EmitDefaultValue = true)] + public string SyncStatus { get; set; } + + /// <summary> + /// Gets or Sets Created + /// </summary> + [DataMember(Name = "created", EmitDefaultValue = false)] + public DateTime Created { get; set; } + + /// <summary> + /// Gets or Sets Updated + /// </summary> + [DataMember(Name = "updated", EmitDefaultValue = false)] + public DateTime Updated { get; set; } + + /// <summary> + /// Gets or Sets Urls + /// </summary> + [DataMember(Name = "urls", EmitDefaultValue = true)] + public List<string> Urls { get; set; } + + /// <summary> + /// Gets or Sets Helm + /// </summary> + [DataMember(Name = "helm", EmitDefaultValue = true)] + public Helm Helm { get; set; } + + /// <summary> + /// Returns the string presentation of the object + /// </summary> + /// <returns>String presentation of the object</returns> + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CloudEnvironment {\n"); + sb.Append(" Labels: ").Append(Labels).Append("\n"); + sb.Append(" AppProjectId: ").Append(AppProjectId).Append("\n"); + sb.Append(" MetadataName: ").Append(MetadataName).Append("\n"); + sb.Append(" TenantId: ").Append(TenantId).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" SyncStatus: ").Append(SyncStatus).Append("\n"); + sb.Append(" Created: ").Append(Created).Append("\n"); + sb.Append(" Updated: ").Append(Updated).Append("\n"); + sb.Append(" Urls: ").Append(Urls).Append("\n"); + sb.Append(" Helm: ").Append(Helm).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// <summary> + /// Returns the JSON string presentation of the object + /// </summary> + /// <returns>JSON string presentation of the object</returns> + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// <summary> + /// Returns true if objects are equal + /// </summary> + /// <param name="input">Object to be compared</param> + /// <returns>Boolean</returns> + public override bool Equals(object input) + { + return this.Equals(input as CloudEnvironment); + } + + /// <summary> + /// Returns true if CloudEnvironment instances are equal + /// </summary> + /// <param name="input">Instance of CloudEnvironment to be compared</param> + /// <returns>Boolean</returns> + public bool Equals(CloudEnvironment input) + { + if (input == null) + { + return false; + } + return + ( + this.Labels == input.Labels || + this.Labels != null && + input.Labels != null && + this.Labels.SequenceEqual(input.Labels) + ) && + ( + this.AppProjectId == input.AppProjectId || + (this.AppProjectId != null && + this.AppProjectId.Equals(input.AppProjectId)) + ) && + ( + this.MetadataName == input.MetadataName || + (this.MetadataName != null && + this.MetadataName.Equals(input.MetadataName)) + ) && + ( + this.TenantId == input.TenantId || + (this.TenantId != null && + this.TenantId.Equals(input.TenantId)) + ) && + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.Status == input.Status || + (this.Status != null && + this.Status.Equals(input.Status)) + ) && + ( + this.SyncStatus == input.SyncStatus || + (this.SyncStatus != null && + this.SyncStatus.Equals(input.SyncStatus)) + ) && + ( + this.Created == input.Created || + (this.Created != null && + this.Created.Equals(input.Created)) + ) && + ( + this.Updated == input.Updated || + (this.Updated != null && + this.Updated.Equals(input.Updated)) + ) && + ( + this.Urls == input.Urls || + this.Urls != null && + input.Urls != null && + this.Urls.SequenceEqual(input.Urls) + ) && + ( + this.Helm == input.Helm || + (this.Helm != null && + this.Helm.Equals(input.Helm)) + ); + } + + /// <summary> + /// Gets the hash code + /// </summary> + /// <returns>Hash code</returns> + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Labels != null) + { + hashCode = (hashCode * 59) + this.Labels.GetHashCode(); + } + if (this.AppProjectId != null) + { + hashCode = (hashCode * 59) + this.AppProjectId.GetHashCode(); + } + if (this.MetadataName != null) + { + hashCode = (hashCode * 59) + this.MetadataName.GetHashCode(); + } + if (this.TenantId != null) + { + hashCode = (hashCode * 59) + this.TenantId.GetHashCode(); + } + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.Status != null) + { + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + } + if (this.SyncStatus != null) + { + hashCode = (hashCode * 59) + this.SyncStatus.GetHashCode(); + } + if (this.Created != null) + { + hashCode = (hashCode * 59) + this.Created.GetHashCode(); + } + if (this.Updated != null) + { + hashCode = (hashCode * 59) + this.Updated.GetHashCode(); + } + if (this.Urls != null) + { + hashCode = (hashCode * 59) + this.Urls.GetHashCode(); + } + if (this.Helm != null) + { + hashCode = (hashCode * 59) + this.Helm.GetHashCode(); + } + return hashCode; + } + } + + /// <summary> + /// To validate all properties of the instance + /// </summary> + /// <param name="validationContext">Validation context</param> + /// <returns>Validation Result</returns> + IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Model/EnvironmentNameValidationRequest.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Model/EnvironmentNameValidationRequest.cs new file mode 100644 index 0000000..eb2d105 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Model/EnvironmentNameValidationRequest.cs @@ -0,0 +1,147 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = VirtoCloud.Client.Client.FileParameter; +using OpenAPIDateConverter = VirtoCloud.Client.Client.OpenAPIDateConverter; + +namespace VirtoCloud.Client.Model +{ + /// <summary> + /// EnvironmentNameValidationRequest + /// </summary> + [DataContract(Name = "EnvironmentNameValidationRequest")] + public partial class EnvironmentNameValidationRequest : IEquatable<EnvironmentNameValidationRequest>, IValidatableObject + { + /// <summary> + /// Initializes a new instance of the <see cref="EnvironmentNameValidationRequest" /> class. + /// </summary> + /// <param name="appProject">appProject.</param> + /// <param name="name">name.</param> + public EnvironmentNameValidationRequest(string appProject = default(string), string name = default(string)) + { + this.AppProject = appProject; + this.Name = name; + } + + /// <summary> + /// Gets or Sets AppProject + /// </summary> + [DataMember(Name = "appProject", EmitDefaultValue = true)] + public string AppProject { get; set; } + + /// <summary> + /// Gets or Sets Name + /// </summary> + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// <summary> + /// Returns the string presentation of the object + /// </summary> + /// <returns>String presentation of the object</returns> + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EnvironmentNameValidationRequest {\n"); + sb.Append(" AppProject: ").Append(AppProject).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// <summary> + /// Returns the JSON string presentation of the object + /// </summary> + /// <returns>JSON string presentation of the object</returns> + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// <summary> + /// Returns true if objects are equal + /// </summary> + /// <param name="input">Object to be compared</param> + /// <returns>Boolean</returns> + public override bool Equals(object input) + { + return this.Equals(input as EnvironmentNameValidationRequest); + } + + /// <summary> + /// Returns true if EnvironmentNameValidationRequest instances are equal + /// </summary> + /// <param name="input">Instance of EnvironmentNameValidationRequest to be compared</param> + /// <returns>Boolean</returns> + public bool Equals(EnvironmentNameValidationRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.AppProject == input.AppProject || + (this.AppProject != null && + this.AppProject.Equals(input.AppProject)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// <summary> + /// Gets the hash code + /// </summary> + /// <returns>Hash code</returns> + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AppProject != null) + { + hashCode = (hashCode * 59) + this.AppProject.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + return hashCode; + } + } + + /// <summary> + /// To validate all properties of the instance + /// </summary> + /// <param name="validationContext">Validation context</param> + /// <returns>Validation Result</returns> + IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Model/Helm.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Model/Helm.cs new file mode 100644 index 0000000..4519325 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Model/Helm.cs @@ -0,0 +1,130 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = VirtoCloud.Client.Client.FileParameter; +using OpenAPIDateConverter = VirtoCloud.Client.Client.OpenAPIDateConverter; + +namespace VirtoCloud.Client.Model +{ + /// <summary> + /// Helm + /// </summary> + [DataContract(Name = "Helm")] + public partial class Helm : IEquatable<Helm>, IValidatableObject + { + /// <summary> + /// Initializes a new instance of the <see cref="Helm" /> class. + /// </summary> + /// <param name="parameters">parameters.</param> + public Helm(Dictionary<string, string> parameters = default(Dictionary<string, string>)) + { + this.Parameters = parameters; + } + + /// <summary> + /// Gets or Sets Parameters + /// </summary> + [DataMember(Name = "parameters", EmitDefaultValue = true)] + public Dictionary<string, string> Parameters { get; set; } + + /// <summary> + /// Returns the string presentation of the object + /// </summary> + /// <returns>String presentation of the object</returns> + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Helm {\n"); + sb.Append(" Parameters: ").Append(Parameters).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// <summary> + /// Returns the JSON string presentation of the object + /// </summary> + /// <returns>JSON string presentation of the object</returns> + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// <summary> + /// Returns true if objects are equal + /// </summary> + /// <param name="input">Object to be compared</param> + /// <returns>Boolean</returns> + public override bool Equals(object input) + { + return this.Equals(input as Helm); + } + + /// <summary> + /// Returns true if Helm instances are equal + /// </summary> + /// <param name="input">Instance of Helm to be compared</param> + /// <returns>Boolean</returns> + public bool Equals(Helm input) + { + if (input == null) + { + return false; + } + return + ( + this.Parameters == input.Parameters || + this.Parameters != null && + input.Parameters != null && + this.Parameters.SequenceEqual(input.Parameters) + ); + } + + /// <summary> + /// Gets the hash code + /// </summary> + /// <returns>Hash code</returns> + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Parameters != null) + { + hashCode = (hashCode * 59) + this.Parameters.GetHashCode(); + } + return hashCode; + } + } + + /// <summary> + /// To validate all properties of the instance + /// </summary> + /// <param name="validationContext">Validation context</param> + /// <returns>Validation Result</returns> + IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Model/HelmObject.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Model/HelmObject.cs new file mode 100644 index 0000000..9e6d1c8 --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Model/HelmObject.cs @@ -0,0 +1,130 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = VirtoCloud.Client.Client.FileParameter; +using OpenAPIDateConverter = VirtoCloud.Client.Client.OpenAPIDateConverter; + +namespace VirtoCloud.Client.Model +{ + /// <summary> + /// HelmObject + /// </summary> + [DataContract(Name = "HelmObject")] + public partial class HelmObject : IEquatable<HelmObject>, IValidatableObject + { + /// <summary> + /// Initializes a new instance of the <see cref="HelmObject" /> class. + /// </summary> + /// <param name="parameters">parameters.</param> + public HelmObject(Dictionary<string, string> parameters = default(Dictionary<string, string>)) + { + this.Parameters = parameters; + } + + /// <summary> + /// Gets or Sets Parameters + /// </summary> + [DataMember(Name = "parameters", EmitDefaultValue = true)] + public Dictionary<string, string> Parameters { get; set; } + + /// <summary> + /// Returns the string presentation of the object + /// </summary> + /// <returns>String presentation of the object</returns> + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class HelmObject {\n"); + sb.Append(" Parameters: ").Append(Parameters).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// <summary> + /// Returns the JSON string presentation of the object + /// </summary> + /// <returns>JSON string presentation of the object</returns> + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// <summary> + /// Returns true if objects are equal + /// </summary> + /// <param name="input">Object to be compared</param> + /// <returns>Boolean</returns> + public override bool Equals(object input) + { + return this.Equals(input as HelmObject); + } + + /// <summary> + /// Returns true if HelmObject instances are equal + /// </summary> + /// <param name="input">Instance of HelmObject to be compared</param> + /// <returns>Boolean</returns> + public bool Equals(HelmObject input) + { + if (input == null) + { + return false; + } + return + ( + this.Parameters == input.Parameters || + this.Parameters != null && + input.Parameters != null && + this.Parameters.SequenceEqual(input.Parameters) + ); + } + + /// <summary> + /// Gets the hash code + /// </summary> + /// <returns>Hash code</returns> + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Parameters != null) + { + hashCode = (hashCode * 59) + this.Parameters.GetHashCode(); + } + return hashCode; + } + } + + /// <summary> + /// To validate all properties of the instance + /// </summary> + /// <param name="validationContext">Validation context</param> + /// <returns>Validation Result</returns> + IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/Model/NewEnvironmentModel.cs b/src/Virtocloud.Client/src/VirtoCloud.Client/Model/NewEnvironmentModel.cs new file mode 100644 index 0000000..006c4cf --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/Model/NewEnvironmentModel.cs @@ -0,0 +1,237 @@ +/* + * VirtoCommerce.SaaS + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = VirtoCloud.Client.Client.FileParameter; +using OpenAPIDateConverter = VirtoCloud.Client.Client.OpenAPIDateConverter; + +namespace VirtoCloud.Client.Model +{ + /// <summary> + /// NewEnvironmentModel + /// </summary> + [DataContract(Name = "NewEnvironmentModel")] + public partial class NewEnvironmentModel : IEquatable<NewEnvironmentModel>, IValidatableObject + { + /// <summary> + /// Initializes a new instance of the <see cref="NewEnvironmentModel" /> class. + /// </summary> + /// <param name="name">name.</param> + /// <param name="dbName">dbName.</param> + /// <param name="appProjectId">appProjectId.</param> + /// <param name="cluster">cluster.</param> + /// <param name="servicePlan">servicePlan.</param> + /// <param name="dbProvider">dbProvider.</param> + /// <param name="helm">helm.</param> + public NewEnvironmentModel(string name = default(string), string dbName = default(string), string appProjectId = default(string), string cluster = default(string), string servicePlan = default(string), string dbProvider = default(string), HelmObject helm = default(HelmObject)) + { + this.Name = name; + this.DbName = dbName; + this.AppProjectId = appProjectId; + this.Cluster = cluster; + this.ServicePlan = servicePlan; + this.DbProvider = dbProvider; + this.Helm = helm; + } + + /// <summary> + /// Gets or Sets Name + /// </summary> + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } + + /// <summary> + /// Gets or Sets DbName + /// </summary> + [DataMember(Name = "dbName", EmitDefaultValue = true)] + public string DbName { get; set; } + + /// <summary> + /// Gets or Sets AppProjectId + /// </summary> + [DataMember(Name = "appProjectId", EmitDefaultValue = true)] + public string AppProjectId { get; set; } + + /// <summary> + /// Gets or Sets Cluster + /// </summary> + [DataMember(Name = "cluster", EmitDefaultValue = true)] + public string Cluster { get; set; } + + /// <summary> + /// Gets or Sets ServicePlan + /// </summary> + [DataMember(Name = "servicePlan", EmitDefaultValue = true)] + public string ServicePlan { get; set; } + + /// <summary> + /// Gets or Sets DbProvider + /// </summary> + [DataMember(Name = "dbProvider", EmitDefaultValue = true)] + public string DbProvider { get; set; } + + /// <summary> + /// Gets or Sets Helm + /// </summary> + [DataMember(Name = "helm", EmitDefaultValue = true)] + public HelmObject Helm { get; set; } + + /// <summary> + /// Returns the string presentation of the object + /// </summary> + /// <returns>String presentation of the object</returns> + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NewEnvironmentModel {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" DbName: ").Append(DbName).Append("\n"); + sb.Append(" AppProjectId: ").Append(AppProjectId).Append("\n"); + sb.Append(" Cluster: ").Append(Cluster).Append("\n"); + sb.Append(" ServicePlan: ").Append(ServicePlan).Append("\n"); + sb.Append(" DbProvider: ").Append(DbProvider).Append("\n"); + sb.Append(" Helm: ").Append(Helm).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// <summary> + /// Returns the JSON string presentation of the object + /// </summary> + /// <returns>JSON string presentation of the object</returns> + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// <summary> + /// Returns true if objects are equal + /// </summary> + /// <param name="input">Object to be compared</param> + /// <returns>Boolean</returns> + public override bool Equals(object input) + { + return this.Equals(input as NewEnvironmentModel); + } + + /// <summary> + /// Returns true if NewEnvironmentModel instances are equal + /// </summary> + /// <param name="input">Instance of NewEnvironmentModel to be compared</param> + /// <returns>Boolean</returns> + public bool Equals(NewEnvironmentModel input) + { + if (input == null) + { + return false; + } + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.DbName == input.DbName || + (this.DbName != null && + this.DbName.Equals(input.DbName)) + ) && + ( + this.AppProjectId == input.AppProjectId || + (this.AppProjectId != null && + this.AppProjectId.Equals(input.AppProjectId)) + ) && + ( + this.Cluster == input.Cluster || + (this.Cluster != null && + this.Cluster.Equals(input.Cluster)) + ) && + ( + this.ServicePlan == input.ServicePlan || + (this.ServicePlan != null && + this.ServicePlan.Equals(input.ServicePlan)) + ) && + ( + this.DbProvider == input.DbProvider || + (this.DbProvider != null && + this.DbProvider.Equals(input.DbProvider)) + ) && + ( + this.Helm == input.Helm || + (this.Helm != null && + this.Helm.Equals(input.Helm)) + ); + } + + /// <summary> + /// Gets the hash code + /// </summary> + /// <returns>Hash code</returns> + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.DbName != null) + { + hashCode = (hashCode * 59) + this.DbName.GetHashCode(); + } + if (this.AppProjectId != null) + { + hashCode = (hashCode * 59) + this.AppProjectId.GetHashCode(); + } + if (this.Cluster != null) + { + hashCode = (hashCode * 59) + this.Cluster.GetHashCode(); + } + if (this.ServicePlan != null) + { + hashCode = (hashCode * 59) + this.ServicePlan.GetHashCode(); + } + if (this.DbProvider != null) + { + hashCode = (hashCode * 59) + this.DbProvider.GetHashCode(); + } + if (this.Helm != null) + { + hashCode = (hashCode * 59) + this.Helm.GetHashCode(); + } + return hashCode; + } + } + + /// <summary> + /// To validate all properties of the instance + /// </summary> + /// <param name="validationContext">Validation context</param> + /// <returns>Validation Result</returns> + IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Virtocloud.Client/src/VirtoCloud.Client/VirtoCloud.Client.csproj b/src/Virtocloud.Client/src/VirtoCloud.Client/VirtoCloud.Client.csproj new file mode 100644 index 0000000..af1160c --- /dev/null +++ b/src/Virtocloud.Client/src/VirtoCloud.Client/VirtoCloud.Client.csproj @@ -0,0 +1,35 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net6.0</TargetFramework> + <AssemblyName>VirtoCloud.Client</AssemblyName> + <AssemblyVersion>1.0.0.0</AssemblyVersion> + <PackageId>VirtoCloud.Client</PackageId> + <OutputType>Library</OutputType> + <Authors>OpenAPI</Authors> + <Company>OpenAPI</Company> + <AssemblyTitle>OpenAPI Library</AssemblyTitle> + <Description>A library generated from a OpenAPI doc</Description> + <Copyright>No Copyright</Copyright> + <RootNamespace>VirtoCloud.Client</RootNamespace> + <Version>1.0.0</Version> + <DocumentationFile>bin\$(Configuration)\$(TargetFramework)\VirtoCloud.Client.xml</DocumentationFile> + <RepositoryUrl>https://github.com/GIT_USER_ID/GIT_REPO_ID.git</RepositoryUrl> + <RepositoryType>git</RepositoryType> + <PackageReleaseNotes>Minor update</PackageReleaseNotes> + <Nullable>annotations</Nullable> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="JsonSubTypes" Version="2.0.1" /> + <PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> + <PackageReference Include="Polly" Version="8.1.0" /> + </ItemGroup> + + <ItemGroup> + <None Remove="System.Web" /> + </ItemGroup> + <ItemGroup> + <Reference Include="System.Web" /> + </ItemGroup> +</Project>