From 28f487406541b405b8a3680aa130ab0c2737c7ba Mon Sep 17 00:00:00 2001 From: "Chaithra.S" Date: Mon, 11 Mar 2024 15:29:49 +0530 Subject: [PATCH 1/2] Changes for AI orchestration --- Conductor/Api/IIntegrationResourceApi.cs | 567 +++ Conductor/Api/IPromptResourceApi.cs | 200 + Conductor/Api/IntegrationResourceApi.cs | 3504 +++++++++++++++++ Conductor/Api/PromptResourceApi.cs | 1257 ++++++ Conductor/Client/Models/EventLog.cs | 220 ++ Conductor/Client/Models/Integration.cs | 319 ++ Conductor/Client/Models/IntegrationApi.cs | 253 ++ .../Client/Models/IntegrationApiUpdate.cs | 140 + Conductor/Client/Models/IntegrationDef.cs | 271 ++ .../Client/Models/IntegrationDefFormField.cs | 371 ++ Conductor/Client/Models/IntegrationUpdate.cs | 206 + Conductor/Client/Models/MessageTemplate.cs | 254 ++ Conductor/Client/Models/Option.cs | 122 + .../Models/PromptTemplateTestRequest.cs | 205 + Conductor/Client/Models/Tag.cs | 138 + Tests/Api/IntegrationResourceApiTests.cs | 472 +++ Tests/Api/PromptResourceApiTest.cs | 244 ++ Tests/Extensions/AssertExtensions.cs | 42 + Tests/Extensions/IntegrationExtensions.cs | 61 + Tests/Helper/JsonHelper.cs | 31 + Tests/Helper/TestConstants.cs | 17 + Tests/TestData/integration_data.json | 18 + Tests/conductor-csharp.test.csproj | 5 + 23 files changed, 8917 insertions(+) create mode 100644 Conductor/Api/IIntegrationResourceApi.cs create mode 100644 Conductor/Api/IPromptResourceApi.cs create mode 100644 Conductor/Api/IntegrationResourceApi.cs create mode 100644 Conductor/Api/PromptResourceApi.cs create mode 100644 Conductor/Client/Models/EventLog.cs create mode 100644 Conductor/Client/Models/Integration.cs create mode 100644 Conductor/Client/Models/IntegrationApi.cs create mode 100644 Conductor/Client/Models/IntegrationApiUpdate.cs create mode 100644 Conductor/Client/Models/IntegrationDef.cs create mode 100644 Conductor/Client/Models/IntegrationDefFormField.cs create mode 100644 Conductor/Client/Models/IntegrationUpdate.cs create mode 100644 Conductor/Client/Models/MessageTemplate.cs create mode 100644 Conductor/Client/Models/Option.cs create mode 100644 Conductor/Client/Models/PromptTemplateTestRequest.cs create mode 100644 Conductor/Client/Models/Tag.cs create mode 100644 Tests/Api/IntegrationResourceApiTests.cs create mode 100644 Tests/Api/PromptResourceApiTest.cs create mode 100644 Tests/Extensions/AssertExtensions.cs create mode 100644 Tests/Extensions/IntegrationExtensions.cs create mode 100644 Tests/Helper/JsonHelper.cs create mode 100644 Tests/Helper/TestConstants.cs create mode 100644 Tests/TestData/integration_data.json diff --git a/Conductor/Api/IIntegrationResourceApi.cs b/Conductor/Api/IIntegrationResourceApi.cs new file mode 100644 index 00000000..b87c0102 --- /dev/null +++ b/Conductor/Api/IIntegrationResourceApi.cs @@ -0,0 +1,567 @@ +using Conductor.Client; +using Conductor.Client.Models; +using System.Collections.Generic; +using EventLog = Conductor.Client.Models.EventLog; +using ThreadTask = System.Threading.Tasks; + +namespace conductor_csharp.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IIntegrationResourceApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Associate a Prompt Template with an Integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + void AssociatePromptWithIntegration(string integrationProvider, string integrationName, string promptName); + + /// + /// Delete an Integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void DeleteIntegrationApi(string name, string integrationName); + + /// + /// Delete an Integration Provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + void DeleteIntegrationProvider(string name); + + /// + /// Delete a tag for Integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the integration associated with the tag + /// The name of the model associated with the tag. + /// + void DeleteTagForIntegration(List body, string name, string integrationName); + + /// + /// Delete a tag for Integration Provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the integration associated with the tag + /// + void DeleteTagForIntegrationProvider(List body, string name); + + /// + /// Get Integration details + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// IntegrationApi + IntegrationApi GetIntegrationApi(string name, string integrationName); + + /// + /// Get Integrations of an Integration Provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// List + List GetIntegrationApis(string name, bool? activeOnly = null); + + /// + /// Get Integrations Available for an Integration Provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// List + List GetIntegrationAvailableApis(string name); + + /// + /// Get Integration provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Integration + Integration GetIntegrationProvider(string name); + + /// + /// Get Integration provider definitions + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List + List GetIntegrationProviderDefs(); + + /// + /// Get all Integrations Providers + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional, default to true) + /// List + List GetIntegrationProviders(string category = null, bool? activeOnly = null); + + /// + /// Get the list of prompt templates associated with an integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// List + List GetPromptsWithIntegration(string integrationProvider, string integrationName); + + /// + /// Get Integrations Providers and Integrations combo + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional, default to true) + /// List + List GetProvidersAndIntegrations(string type = null, bool? activeOnly = null); + + /// + /// Get tags by Integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// List + List GetTagsForIntegration(string name, string integrationName); + + /// + /// Get tags by Integration Provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// List + List GetTagsForIntegrationProvider(string name); + + /// + /// Get Token Usage by Integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// int? + int? GetTokenUsageForIntegration(string name, string integrationName); + + /// + /// Get Token Usage by Integration Provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Dictionary + Dictionary GetTokenUsageForIntegrationProvider(string name); + + /// + /// Put a tag to Integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the integration to associate the tag with. + /// The name of the model to associate the tag with. + /// + void PutTagForIntegration(List body, string name, string integrationName); + + /// + /// Put a tag to Integration Provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the integration to associate the tag with. + /// + void PutTagForIntegrationProvider(List body, string name); + + /// + /// Record Event Stats + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void RecordEventStats(List body, string type); + + /// + /// Register Token usage + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + void RegisterTokenUsage(int? body, string name, string integrationName); + + /// + /// Create or Update Integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + void SaveIntegrationApi(IntegrationApiUpdate body, string name, string integrationName); + + /// + /// Create or Update Integration provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void SaveIntegrationProvider(IntegrationUpdate body, string name); + + #endregion Synchronous Operations + + #region Asynchronous Operations + /// + /// Associate a Prompt Template with an Integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Task of void + ThreadTask.Task AssociatePromptWithIntegrationAsync(string integrationProvider, string integrationName, string promptName); + + /// + /// Delete an Integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of void + ThreadTask.Task DeleteIntegrationApiAsync(string name, string integrationName); + + /// + /// Delete an Integration Provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Task of void + ThreadTask.Task DeleteIntegrationProviderAsync(string name); + + /// + /// Delete a tag for Integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the integration associated with the tag + /// The name of the model associated with the tag. + /// Task of void + ThreadTask.Task DeleteTagForIntegrationAsync(List body, string name, string integrationName); + + /// + /// Delete a tag for Integration Provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the integration associated with the tag + /// Task of void + ThreadTask.Task DeleteTagForIntegrationProviderAsync(List body, string name); + + /// + /// Get Integration details + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of IntegrationApi + ThreadTask.Task GetIntegrationApiAsync(string name, string integrationName); + + /// + /// Get Integrations of an Integration Provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// Task of List + ThreadTask.Task> GetIntegrationApisAsync(string name, bool? activeOnly = null); + + /// + /// Get Integrations Available for an Integration Provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Task of List + ThreadTask.Task> GetIntegrationAvailableApisAsync(string name); + + /// + /// Get Integration provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Task of Integration + ThreadTask.Task GetIntegrationProviderAsync(string name); + + /// + /// Get Integration provider definitions + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Task of List + ThreadTask.Task> GetIntegrationProviderDefsAsync(); + + /// + /// Get all Integrations Providers + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional, default to true) + /// Task of List + ThreadTask.Task> GetIntegrationProvidersAsync(string category = null, bool? activeOnly = null); + + /// + /// Get the list of prompt templates associated with an integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of List + ThreadTask.Task> GetPromptsWithIntegrationAsync(string integrationProvider, string integrationName); + + /// + /// Get Integrations Providers and Integrations combo + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional, default to true) + /// Task of List + ThreadTask.Task> GetProvidersAndIntegrationsAsync(string type = null, bool? activeOnly = null); + + /// + /// Get tags by Integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of List + ThreadTask.Task> GetTagsForIntegrationAsync(string name, string integrationName); + + /// + /// Get tags by Integration Provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Task of List + ThreadTask.Task> GetTagsForIntegrationProviderAsync(string name); + + /// + /// Get Token Usage by Integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of int? + ThreadTask.Task GetTokenUsageForIntegrationAsync(string name, string integrationName); + + /// + /// Get Token Usage by Integration Provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Task of Dictionary + ThreadTask.Task> GetTokenUsageForIntegrationProviderAsync(string name); + + /// + /// Put a tag to Integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the integration to associate the tag with. + /// The name of the model to associate the tag with. + /// Task of void + ThreadTask.Task PutTagForIntegrationAsync(List body, string name, string integrationName); + + /// + /// Put a tag to Integration Provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the integration to associate the tag with. + /// Task of void + ThreadTask.Task PutTagForIntegrationProviderAsync(List body, string name); + + /// + /// Record Event Stats + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of void + ThreadTask.Task RecordEventStatsAsync(List body, string type); + + /// + /// Register Token usage + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Task of void + ThreadTask.Task RegisterTokenUsageAsync(int? body, string name, string integrationName); + + /// + /// Create or Update Integration + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Task of void + ThreadTask.Task SaveIntegrationApiAsync(IntegrationApiUpdate body, string name, string integrationName); + + /// + /// Create or Update Integration provider + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of void + ThreadTask.Task SaveIntegrationProviderAsync(IntegrationUpdate body, string name); + #endregion Asynchronous Operations + } +} diff --git a/Conductor/Api/IPromptResourceApi.cs b/Conductor/Api/IPromptResourceApi.cs new file mode 100644 index 00000000..37a887c1 --- /dev/null +++ b/Conductor/Api/IPromptResourceApi.cs @@ -0,0 +1,200 @@ +using Conductor.Client; +using Conductor.Client.Models; +using System.Collections.Generic; + +namespace conductor_csharp.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPromptResourceApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Delete Template + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + void DeleteMessageTemplate(string name); + + /// + /// Delete a tag for Prompt Template + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the Prompt the tag should be deleted from. + /// + void DeleteTagForPromptTemplate(List body, string name); + + /// + /// Get Template + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// MessageTemplate + MessageTemplate GetMessageTemplate(string name); + + /// + /// Get Templates + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List + List GetMessageTemplates(); + + /// + /// Get tags by Prompt Template + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// List + List GetTagsForPromptTemplate(string name); + + /// + /// Put a tag to Prompt Template + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the Prompt the tag should be updated with. + /// + void PutTagForPromptTemplate(List body, string name); + + /// + /// Create or Update Template + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// (optional) + /// + void SaveMessageTemplate(string body, string description, string name, List models = null); + + /// + /// Test Prompt Template + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// string + string TestMessageTemplate(PromptTemplateTestRequest body); + + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// Delete Template + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Task of void + System.Threading.Tasks.Task DeleteMessageTemplateAsync(string name); + + /// + /// Delete a tag for Prompt Template + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the Prompt the tag should be deleted from. + /// Task of void + System.Threading.Tasks.Task DeleteTagForPromptTemplateAsync(List body, string name); + + /// + /// Get Template + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Task of MessageTemplate + System.Threading.Tasks.Task GetMessageTemplateAsync(string name); + + /// + /// Get Templates + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Task of List + System.Threading.Tasks.Task> GetMessageTemplatesAsync(); + + /// + /// Get tags by Prompt Template + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Task of List + System.Threading.Tasks.Task> GetTagsForPromptTemplateAsync(string name); + + /// + /// Put a tag to Prompt Template + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the Prompt the tag should be updated with. + /// Task of void + System.Threading.Tasks.Task PutTagForPromptTemplateAsync(List body, string name); + + /// + /// Create or Update Template + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// (optional) + /// Task of void + System.Threading.Tasks.Task SaveMessageTemplateAsync(string body, string description, string name, List models = null); + + /// + /// Test Prompt Template + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Task of string + System.Threading.Tasks.Task TestMessageTemplateAsync(PromptTemplateTestRequest body); + #endregion Asynchronous Operations + } +} diff --git a/Conductor/Api/IntegrationResourceApi.cs b/Conductor/Api/IntegrationResourceApi.cs new file mode 100644 index 00000000..c946818f --- /dev/null +++ b/Conductor/Api/IntegrationResourceApi.cs @@ -0,0 +1,3504 @@ +using Conductor.Client; +using Conductor.Client.Models; +using conductor_csharp.Api; +using RestSharp; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Conductor.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class IntegrationResourceApi : IIntegrationResourceApi + { + private ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public IntegrationResourceApi(string basePath) + { + this.Configuration = new Conductor.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// + /// + public IntegrationResourceApi() + { + this.Configuration = Conductor.Client.Configuration.Default; + + ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public IntegrationResourceApi(Conductor.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = Conductor.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.ApiClient.RestClient.Options.BaseUrl.ToString(); + } + + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Conductor.Client.Configuration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Conductor.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; } + } + + /// + /// Associate a Prompt Template with an Integration + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + public void AssociatePromptWithIntegration(string integrationProvider, string integrationName, string promptName) + { + AssociatePromptWithIntegrationWithHttpInfo(integrationProvider, integrationName, promptName); + } + + /// + /// Associate a Prompt Template with an Integration + /// + /// Thrown when fails to make API call + /// + /// + /// + /// ApiResponse of Object(void) + public ApiResponse AssociatePromptWithIntegrationWithHttpInfo(string integrationProvider, string integrationName, string promptName) + { + // verify the required parameter 'integrationProvider' is set + if (integrationProvider == null) + throw new ApiException(400, "Missing required parameter 'integrationProvider' when calling IntegrationResourceApi->AssociatePromptWithIntegration"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->AssociatePromptWithIntegration"); + // verify the required parameter 'promptName' is set + if (promptName == null) + throw new ApiException(400, "Missing required parameter 'promptName' when calling IntegrationResourceApi->AssociatePromptWithIntegration"); + + var localVarPath = "/integrations/provider/{integration_provider}/integration/{integration_name}/prompt/{prompt_name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (integrationProvider != null) localVarPathParams.Add("integration_provider", this.Configuration.ApiClient.ParameterToString(integrationProvider)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + if (promptName != null) localVarPathParams.Add("prompt_name", this.Configuration.ApiClient.ParameterToString(promptName)); // path parameter + // authentication (api_key) required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, this.Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("AssociatePromptWithIntegration", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); + } + + /// + /// Associate a Prompt Template with an Integration + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Task of void + public async System.Threading.Tasks.Task AssociatePromptWithIntegrationAsync(string integrationProvider, string integrationName, string promptName) + { + await AssociatePromptWithIntegrationAsyncWithHttpInfo(integrationProvider, integrationName, promptName); + + } + + /// + /// Associate a Prompt Template with an Integration + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> AssociatePromptWithIntegrationAsyncWithHttpInfo(string integrationProvider, string integrationName, string promptName) + { + // verify the required parameter 'integrationProvider' is set + if (integrationProvider == null) + throw new ApiException(400, "Missing required parameter 'integrationProvider' when calling IntegrationResourceApi->AssociatePromptWithIntegration"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->AssociatePromptWithIntegration"); + // verify the required parameter 'promptName' is set + if (promptName == null) + throw new ApiException(400, "Missing required parameter 'promptName' when calling IntegrationResourceApi->AssociatePromptWithIntegration"); + + var localVarPath = "/integrations/provider/{integration_provider}/integration/{integration_name}/prompt/{prompt_name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (integrationProvider != null) localVarPathParams.Add("integration_provider", this.Configuration.ApiClient.ParameterToString(integrationProvider)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + if (promptName != null) localVarPathParams.Add("prompt_name", this.Configuration.ApiClient.ParameterToString(promptName)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("AssociatePromptWithIntegration", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Delete an Integration + /// + /// Thrown when fails to make API call + /// + /// + /// + public void DeleteIntegrationApi(string name, string integrationName) + { + DeleteIntegrationApiWithHttpInfo(name, integrationName); + } + + /// + /// Delete an Integration + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + public ApiResponse DeleteIntegrationApiWithHttpInfo(string name, string integrationName) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->DeleteIntegrationApi"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->DeleteIntegrationApi"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteIntegrationApi", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Delete an Integration + /// + /// Thrown when fails to make API call + /// + /// + /// Task of void + public async System.Threading.Tasks.Task DeleteIntegrationApiAsync(string name, string integrationName) + { + await DeleteIntegrationApiAsyncWithHttpInfo(name, integrationName); + + } + + /// + /// Delete an Integration + /// + /// Thrown when fails to make API call + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteIntegrationApiAsyncWithHttpInfo(string name, string integrationName) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->DeleteIntegrationApi"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->DeleteIntegrationApi"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteIntegrationApi", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Delete an Integration Provider + /// + /// Thrown when fails to make API call + /// + /// + public void DeleteIntegrationProvider(string name) + { + DeleteIntegrationProviderWithHttpInfo(name); + } + + /// + /// Delete an Integration Provider + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + public ApiResponse DeleteIntegrationProviderWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->DeleteIntegrationProvider"); + + var localVarPath = "/integrations/provider/{name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteIntegrationProvider", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Delete an Integration Provider + /// + /// Thrown when fails to make API call + /// + /// Task of void + public async System.Threading.Tasks.Task DeleteIntegrationProviderAsync(string name) + { + await DeleteIntegrationProviderAsyncWithHttpInfo(name); + + } + + /// + /// Delete an Integration Provider + /// + /// Thrown when fails to make API call + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteIntegrationProviderAsyncWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->DeleteIntegrationProvider"); + + var localVarPath = "/integrations/provider/{name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteIntegrationProvider", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Delete a tag for Integration + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the integration associated with the tag + /// The name of the model associated with the tag. + /// + public void DeleteTagForIntegration(List body, string name, string integrationName) + { + DeleteTagForIntegrationWithHttpInfo(body, name, integrationName); + } + + /// + /// Delete a tag for Integration + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the integration associated with the tag + /// The name of the model associated with the tag. + /// ApiResponse of Object(void) + public ApiResponse DeleteTagForIntegrationWithHttpInfo(List body, string name, string integrationName) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->DeleteTagForIntegration"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->DeleteTagForIntegration"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->DeleteTagForIntegration"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteTagForIntegration", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Delete a tag for Integration + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the integration associated with the tag + /// The name of the model associated with the tag. + /// Task of void + public async System.Threading.Tasks.Task DeleteTagForIntegrationAsync(List body, string name, string integrationName) + { + await DeleteTagForIntegrationAsyncWithHttpInfo(body, name, integrationName); + + } + + /// + /// Delete a tag for Integration + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the integration associated with the tag + /// The name of the model associated with the tag. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteTagForIntegrationAsyncWithHttpInfo(List body, string name, string integrationName) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->DeleteTagForIntegration"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->DeleteTagForIntegration"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->DeleteTagForIntegration"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteTagForIntegration", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Delete a tag for Integration Provider + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the integration associated with the tag + /// + public void DeleteTagForIntegrationProvider(List body, string name) + { + DeleteTagForIntegrationProviderWithHttpInfo(body, name); + } + + /// + /// Delete a tag for Integration Provider + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the integration associated with the tag + /// ApiResponse of Object(void) + public ApiResponse DeleteTagForIntegrationProviderWithHttpInfo(List body, string name) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->DeleteTagForIntegrationProvider"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->DeleteTagForIntegrationProvider"); + + var localVarPath = "/integrations/provider/{name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteTagForIntegrationProvider", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Delete a tag for Integration Provider + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the integration associated with the tag + /// Task of void + public async System.Threading.Tasks.Task DeleteTagForIntegrationProviderAsync(List body, string name) + { + await DeleteTagForIntegrationProviderAsyncWithHttpInfo(body, name); + + } + + /// + /// Delete a tag for Integration Provider + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the integration associated with the tag + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteTagForIntegrationProviderAsyncWithHttpInfo(List body, string name) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->DeleteTagForIntegrationProvider"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->DeleteTagForIntegrationProvider"); + + var localVarPath = "/integrations/provider/{name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteTagForIntegrationProvider", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Get Integration details + /// + /// Thrown when fails to make API call + /// + /// + /// IntegrationApi + public IntegrationApi GetIntegrationApi(string name, string integrationName) + { + ApiResponse localVarResponse = GetIntegrationApiWithHttpInfo(name, integrationName); + return localVarResponse.Data; + } + + /// + /// Get Integration details + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of IntegrationApi + public ApiResponse GetIntegrationApiWithHttpInfo(string name, string integrationName) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetIntegrationApi"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->GetIntegrationApi"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetIntegrationApi", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (IntegrationApi)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(IntegrationApi))); + } + + /// + /// Get Integration details + /// + /// Thrown when fails to make API call + /// + /// + /// Task of IntegrationApi + public async System.Threading.Tasks.Task GetIntegrationApiAsync(string name, string integrationName) + { + ApiResponse localVarResponse = await GetIntegrationApiAsyncWithHttpInfo(name, integrationName); + return localVarResponse.Data; + + } + + /// + /// Get Integration details + /// + /// Thrown when fails to make API call + /// + /// + /// Task of ApiResponse (IntegrationApi) + public async System.Threading.Tasks.Task> GetIntegrationApiAsyncWithHttpInfo(string name, string integrationName) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetIntegrationApi"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->GetIntegrationApi"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetIntegrationApi", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (IntegrationApi)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(IntegrationApi))); + } + + /// + /// Get Integrations of an Integration Provider + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// List + public List GetIntegrationApis(string name, bool? activeOnly = null) + { + ApiResponse> localVarResponse = GetIntegrationApisWithHttpInfo(name, activeOnly); + return localVarResponse.Data; + } + + /// + /// Get Integrations of an Integration Provider + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// ApiResponse of List + public ApiResponse> GetIntegrationApisWithHttpInfo(string name, bool? activeOnly = null) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetIntegrationApis"); + + var localVarPath = "/integrations/provider/{name}/integration"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (activeOnly != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "activeOnly", activeOnly)); // query parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetIntegrationApis", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get Integrations of an Integration Provider + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// Task of List + public async System.Threading.Tasks.Task> GetIntegrationApisAsync(string name, bool? activeOnly = null) + { + ApiResponse> localVarResponse = await GetIntegrationApisAsyncWithHttpInfo(name, activeOnly); + return localVarResponse.Data; + + } + + /// + /// Get Integrations of an Integration Provider + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// Task of ApiResponse (List) + public async System.Threading.Tasks.Task>> GetIntegrationApisAsyncWithHttpInfo(string name, bool? activeOnly = null) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetIntegrationApis"); + + var localVarPath = "/integrations/provider/{name}/integration"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (activeOnly != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "activeOnly", activeOnly)); // query parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetIntegrationApis", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get Integrations Available for an Integration Provider + /// + /// Thrown when fails to make API call + /// + /// List + public List GetIntegrationAvailableApis(string name) + { + ApiResponse> localVarResponse = GetIntegrationAvailableApisWithHttpInfo(name); + return localVarResponse.Data; + } + + /// + /// Get Integrations Available for an Integration Provider + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List + public ApiResponse> GetIntegrationAvailableApisWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetIntegrationAvailableApis"); + + var localVarPath = "/integrations/provider/{name}/integration/all"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetIntegrationAvailableApis", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get Integrations Available for an Integration Provider + /// + /// Thrown when fails to make API call + /// + /// Task of List + public async System.Threading.Tasks.Task> GetIntegrationAvailableApisAsync(string name) + { + ApiResponse> localVarResponse = await GetIntegrationAvailableApisAsyncWithHttpInfo(name); + return localVarResponse.Data; + + } + + /// + /// Get Integrations Available for an Integration Provider + /// + /// Thrown when fails to make API call + /// + /// Task of ApiResponse (List) + public async System.Threading.Tasks.Task>> GetIntegrationAvailableApisAsyncWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetIntegrationAvailableApis"); + + var localVarPath = "/integrations/provider/{name}/integration/all"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetIntegrationAvailableApis", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get Integration provider + /// + /// Thrown when fails to make API call + /// + /// Integration + public Integration GetIntegrationProvider(string name) + { + ApiResponse localVarResponse = GetIntegrationProviderWithHttpInfo(name); + return localVarResponse.Data; + } + + /// + /// Get Integration provider + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Integration + public ApiResponse GetIntegrationProviderWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetIntegrationProvider"); + + var localVarPath = "/integrations/provider/{name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetIntegrationProvider", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (Integration)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Integration))); + } + + /// + /// Get Integration provider + /// + /// Thrown when fails to make API call + /// + /// Task of Integration + public async System.Threading.Tasks.Task GetIntegrationProviderAsync(string name) + { + ApiResponse localVarResponse = await GetIntegrationProviderAsyncWithHttpInfo(name); + return localVarResponse.Data; + + } + + /// + /// Get Integration provider + /// + /// Thrown when fails to make API call + /// + /// Task of ApiResponse (Integration) + public async System.Threading.Tasks.Task> GetIntegrationProviderAsyncWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetIntegrationProvider"); + + var localVarPath = "/integrations/provider/{name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetIntegrationProvider", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (Integration)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Integration))); + } + + /// + /// Get Integration provider definitions + /// + /// Thrown when fails to make API call + /// List + public List GetIntegrationProviderDefs() + { + ApiResponse> localVarResponse = GetIntegrationProviderDefsWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get Integration provider definitions + /// + /// Thrown when fails to make API call + /// ApiResponse of List + public ApiResponse> GetIntegrationProviderDefsWithHttpInfo() + { + + var localVarPath = "/integrations/def"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetIntegrationProviderDefs", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get Integration provider definitions + /// + /// Thrown when fails to make API call + /// Task of List + public async System.Threading.Tasks.Task> GetIntegrationProviderDefsAsync() + { + ApiResponse> localVarResponse = await GetIntegrationProviderDefsAsyncWithHttpInfo(); + return localVarResponse.Data; + + } + + /// + /// Get Integration provider definitions + /// + /// Thrown when fails to make API call + /// Task of ApiResponse (List) + public async System.Threading.Tasks.Task>> GetIntegrationProviderDefsAsyncWithHttpInfo() + { + + var localVarPath = "/integrations/def"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetIntegrationProviderDefs", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get all Integrations Providers + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional, default to true) + /// List + public List GetIntegrationProviders(string category = null, bool? activeOnly = null) + { + ApiResponse> localVarResponse = GetIntegrationProvidersWithHttpInfo(category, activeOnly); + return localVarResponse.Data; + } + + /// + /// Get all Integrations Providers + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional, default to true) + /// ApiResponse of List + public ApiResponse> GetIntegrationProvidersWithHttpInfo(string category = null, bool? activeOnly = null) + { + + var localVarPath = "/integrations/provider"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (category != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "category", category)); // query parameter + if (activeOnly != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "activeOnly", activeOnly)); // query parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetIntegrationProviders", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get all Integrations Providers + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional, default to true) + /// Task of List + public async System.Threading.Tasks.Task> GetIntegrationProvidersAsync(string category = null, bool? activeOnly = null) + { + ApiResponse> localVarResponse = await GetIntegrationProvidersAsyncWithHttpInfo(category, activeOnly); + return localVarResponse.Data; + + } + + /// + /// Get all Integrations Providers + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional, default to true) + /// Task of ApiResponse (List) + public async System.Threading.Tasks.Task>> GetIntegrationProvidersAsyncWithHttpInfo(string category = null, bool? activeOnly = null) + { + + var localVarPath = "/integrations/provider"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (category != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "category", category)); // query parameter + if (activeOnly != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "activeOnly", activeOnly)); // query parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetIntegrationProviders", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get the list of prompt templates associated with an integration + /// + /// Thrown when fails to make API call + /// + /// + /// List + public List GetPromptsWithIntegration(string integrationProvider, string integrationName) + { + ApiResponse> localVarResponse = GetPromptsWithIntegrationWithHttpInfo(integrationProvider, integrationName); + return localVarResponse.Data; + } + + /// + /// Get the list of prompt templates associated with an integration + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of List + public ApiResponse> GetPromptsWithIntegrationWithHttpInfo(string integrationProvider, string integrationName) + { + // verify the required parameter 'integrationProvider' is set + if (integrationProvider == null) + throw new ApiException(400, "Missing required parameter 'integrationProvider' when calling IntegrationResourceApi->GetPromptsWithIntegration"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->GetPromptsWithIntegration"); + + var localVarPath = "/integrations/provider/{integration_provider}/integration/{integration_name}/prompt"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (integrationProvider != null) localVarPathParams.Add("integration_provider", this.Configuration.ApiClient.ParameterToString(integrationProvider)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetPromptsWithIntegration", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get the list of prompt templates associated with an integration + /// + /// Thrown when fails to make API call + /// + /// + /// Task of List + public async System.Threading.Tasks.Task> GetPromptsWithIntegrationAsync(string integrationProvider, string integrationName) + { + ApiResponse> localVarResponse = await GetPromptsWithIntegrationAsyncWithHttpInfo(integrationProvider, integrationName); + return localVarResponse.Data; + + } + + /// + /// Get the list of prompt templates associated with an integration + /// + /// Thrown when fails to make API call + /// + /// + /// Task of ApiResponse (List) + public async System.Threading.Tasks.Task>> GetPromptsWithIntegrationAsyncWithHttpInfo(string integrationProvider, string integrationName) + { + // verify the required parameter 'integrationProvider' is set + if (integrationProvider == null) + throw new ApiException(400, "Missing required parameter 'integrationProvider' when calling IntegrationResourceApi->GetPromptsWithIntegration"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->GetPromptsWithIntegration"); + + var localVarPath = "/integrations/provider/{integration_provider}/integration/{integration_name}/prompt"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (integrationProvider != null) localVarPathParams.Add("integration_provider", this.Configuration.ApiClient.ParameterToString(integrationProvider)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetPromptsWithIntegration", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get Integrations Providers and Integrations combo + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional, default to true) + /// List + public List GetProvidersAndIntegrations(string type = null, bool? activeOnly = null) + { + ApiResponse> localVarResponse = GetProvidersAndIntegrationsWithHttpInfo(type, activeOnly); + return localVarResponse.Data; + } + + /// + /// Get Integrations Providers and Integrations combo + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional, default to true) + /// ApiResponse of List + public ApiResponse> GetProvidersAndIntegrationsWithHttpInfo(string type = null, bool? activeOnly = null) + { + + var localVarPath = "/integrations/all"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { " application/json " }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (type != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "type", type)); // query parameter + if (activeOnly != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "activeOnly", activeOnly)); // query parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetProvidersAndIntegrations", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get Integrations Providers and Integrations combo + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional, default to true) + /// Task of List + public async System.Threading.Tasks.Task> GetProvidersAndIntegrationsAsync(string type = null, bool? activeOnly = null) + { + ApiResponse> localVarResponse = await GetProvidersAndIntegrationsAsyncWithHttpInfo(type, activeOnly); + return localVarResponse.Data; + + } + + /// + /// Get Integrations Providers and Integrations combo + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional, default to true) + /// Task of ApiResponse (List) + public async System.Threading.Tasks.Task>> GetProvidersAndIntegrationsAsyncWithHttpInfo(string type = null, bool? activeOnly = null) + { + + var localVarPath = "/integrations/all"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (type != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "type", type)); // query parameter + if (activeOnly != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "activeOnly", activeOnly)); // query parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetProvidersAndIntegrations", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get tags by Integration + /// + /// Thrown when fails to make API call + /// + /// + /// List + public List GetTagsForIntegration(string name, string integrationName) + { + ApiResponse> localVarResponse = GetTagsForIntegrationWithHttpInfo(name, integrationName); + return localVarResponse.Data; + } + + /// + /// Get tags by Integration + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of List + public ApiResponse> GetTagsForIntegrationWithHttpInfo(string name, string integrationName) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetTagsForIntegration"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->GetTagsForIntegration"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetTagsForIntegration", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get tags by Integration + /// + /// Thrown when fails to make API call + /// + /// + /// Task of List + public async System.Threading.Tasks.Task> GetTagsForIntegrationAsync(string name, string integrationName) + { + ApiResponse> localVarResponse = await GetTagsForIntegrationAsyncWithHttpInfo(name, integrationName); + return localVarResponse.Data; + + } + + /// + /// Get tags by Integration + /// + /// Thrown when fails to make API call + /// + /// + /// Task of ApiResponse (List) + public async System.Threading.Tasks.Task>> GetTagsForIntegrationAsyncWithHttpInfo(string name, string integrationName) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetTagsForIntegration"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->GetTagsForIntegration"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetTagsForIntegration", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get tags by Integration Provider + /// + /// Thrown when fails to make API call + /// + /// List + public List GetTagsForIntegrationProvider(string name) + { + ApiResponse> localVarResponse = GetTagsForIntegrationProviderWithHttpInfo(name); + return localVarResponse.Data; + } + + /// + /// Get tags by Integration Provider + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List + public ApiResponse> GetTagsForIntegrationProviderWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetTagsForIntegrationProvider"); + + var localVarPath = "/integrations/provider/{name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetTagsForIntegrationProvider", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get tags by Integration Provider + /// + /// Thrown when fails to make API call + /// + /// Task of List + public async System.Threading.Tasks.Task> GetTagsForIntegrationProviderAsync(string name) + { + ApiResponse> localVarResponse = await GetTagsForIntegrationProviderAsyncWithHttpInfo(name); + return localVarResponse.Data; + + } + + /// + /// Get tags by Integration Provider + /// + /// Thrown when fails to make API call + /// + /// Task of ApiResponse (List) + public async System.Threading.Tasks.Task>> GetTagsForIntegrationProviderAsyncWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetTagsForIntegrationProvider"); + + var localVarPath = "/integrations/provider/{name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetTagsForIntegrationProvider", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get Token Usage by Integration + /// + /// Thrown when fails to make API call + /// + /// + /// int? + public int? GetTokenUsageForIntegration(string name, string integrationName) + { + ApiResponse localVarResponse = GetTokenUsageForIntegrationWithHttpInfo(name, integrationName); + return localVarResponse.Data; + } + + /// + /// Get Token Usage by Integration + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of int? + public ApiResponse GetTokenUsageForIntegrationWithHttpInfo(string name, string integrationName) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetTokenUsageForIntegration"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->GetTokenUsageForIntegration"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}/metrics"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetTokenUsageForIntegration", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (int?)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(int?))); + } + + /// + /// Get Token Usage by Integration + /// + /// Thrown when fails to make API call + /// + /// + /// Task of int? + public async System.Threading.Tasks.Task GetTokenUsageForIntegrationAsync(string name, string integrationName) + { + ApiResponse localVarResponse = await GetTokenUsageForIntegrationAsyncWithHttpInfo(name, integrationName); + return localVarResponse.Data; + + } + + /// + /// Get Token Usage by Integration + /// + /// Thrown when fails to make API call + /// + /// + /// Task of ApiResponse (int?) + public async System.Threading.Tasks.Task> GetTokenUsageForIntegrationAsyncWithHttpInfo(string name, string integrationName) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetTokenUsageForIntegration"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->GetTokenUsageForIntegration"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}/metrics"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetTokenUsageForIntegration", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (int?)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(int?))); + } + + /// + /// Get Token Usage by Integration Provider + /// + /// Thrown when fails to make API call + /// + /// Dictionary + public Dictionary GetTokenUsageForIntegrationProvider(string name) + { + ApiResponse> localVarResponse = GetTokenUsageForIntegrationProviderWithHttpInfo(name); + return localVarResponse.Data; + } + + /// + /// Get Token Usage by Integration Provider + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Dictionary + public ApiResponse> GetTokenUsageForIntegrationProviderWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetTokenUsageForIntegrationProvider"); + + var localVarPath = "/integrations/provider/{name}/metrics"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetTokenUsageForIntegrationProvider", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (Dictionary)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + } + + /// + /// Get Token Usage by Integration Provider + /// + /// Thrown when fails to make API call + /// + /// Task of Dictionary + public async System.Threading.Tasks.Task> GetTokenUsageForIntegrationProviderAsync(string name) + { + ApiResponse> localVarResponse = await GetTokenUsageForIntegrationProviderAsyncWithHttpInfo(name); + return localVarResponse.Data; + + } + + /// + /// Get Token Usage by Integration Provider + /// + /// Thrown when fails to make API call + /// + /// Task of ApiResponse (Dictionary) + public async System.Threading.Tasks.Task>> GetTokenUsageForIntegrationProviderAsyncWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->GetTokenUsageForIntegrationProvider"); + + var localVarPath = "/integrations/provider/{name}/metrics"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetTokenUsageForIntegrationProvider", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (Dictionary)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + } + + /// + /// Put a tag to Integration + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the integration to associate the tag with. + /// The name of the model to associate the tag with. + /// + public void PutTagForIntegration(List body, string name, string integrationName) + { + PutTagForIntegrationWithHttpInfo(body, name, integrationName); + } + + /// + /// Put a tag to Integration + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the integration to associate the tag with. + /// The name of the model to associate the tag with. + /// ApiResponse of Object(void) + public ApiResponse PutTagForIntegrationWithHttpInfo(List body, string name, string integrationName) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->PutTagForIntegration"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->PutTagForIntegration"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->PutTagForIntegration"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("PutTagForIntegration", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Put a tag to Integration + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the integration to associate the tag with. + /// The name of the model to associate the tag with. + /// Task of void + public async System.Threading.Tasks.Task PutTagForIntegrationAsync(List body, string name, string integrationName) + { + await PutTagForIntegrationAsyncWithHttpInfo(body, name, integrationName); + + } + + /// + /// Put a tag to Integration + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the integration to associate the tag with. + /// The name of the model to associate the tag with. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> PutTagForIntegrationAsyncWithHttpInfo(List body, string name, string integrationName) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->PutTagForIntegration"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->PutTagForIntegration"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->PutTagForIntegration"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("PutTagForIntegration", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Put a tag to Integration Provider + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the integration to associate the tag with. + /// + public void PutTagForIntegrationProvider(List body, string name) + { + PutTagForIntegrationProviderWithHttpInfo(body, name); + } + + /// + /// Put a tag to Integration Provider + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the integration to associate the tag with. + /// ApiResponse of Object(void) + public ApiResponse PutTagForIntegrationProviderWithHttpInfo(List body, string name) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->PutTagForIntegrationProvider"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->PutTagForIntegrationProvider"); + + var localVarPath = "/integrations/provider/{name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("PutTagForIntegrationProvider", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Put a tag to Integration Provider + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the integration to associate the tag with. + /// Task of void + public async System.Threading.Tasks.Task PutTagForIntegrationProviderAsync(List body, string name) + { + await PutTagForIntegrationProviderAsyncWithHttpInfo(body, name); + + } + + /// + /// Put a tag to Integration Provider + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the integration to associate the tag with. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> PutTagForIntegrationProviderAsyncWithHttpInfo(List body, string name) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->PutTagForIntegrationProvider"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->PutTagForIntegrationProvider"); + + var localVarPath = "/integrations/provider/{name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("PutTagForIntegrationProvider", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Record Event Stats + /// + /// Thrown when fails to make API call + /// + /// + /// + public void RecordEventStats(List body, string type) + { + RecordEventStatsWithHttpInfo(body, type); + } + + /// + /// Record Event Stats + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + public ApiResponse RecordEventStatsWithHttpInfo(List body, string type) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->RecordEventStats"); + // verify the required parameter 'type' is set + if (type == null) + throw new ApiException(400, "Missing required parameter 'type' when calling IntegrationResourceApi->RecordEventStats"); + + var localVarPath = "/integrations/eventStats/{type}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (type != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "type", type)); // query parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("RecordEventStats", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Record Event Stats + /// + /// Thrown when fails to make API call + /// + /// + /// Task of void + public async System.Threading.Tasks.Task RecordEventStatsAsync(List body, string type) + { + await RecordEventStatsAsyncWithHttpInfo(body, type); + + } + + /// + /// Record Event Stats + /// + /// Thrown when fails to make API call + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> RecordEventStatsAsyncWithHttpInfo(List body, string type) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->RecordEventStats"); + // verify the required parameter 'type' is set + if (type == null) + throw new ApiException(400, "Missing required parameter 'type' when calling IntegrationResourceApi->RecordEventStats"); + + var localVarPath = "/integrations/eventStats/{type}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (type != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "type", type)); // query parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("RecordEventStats", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Register Token usage + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + public void RegisterTokenUsage(int? body, string name, string integrationName) + { + RegisterTokenUsageWithHttpInfo(body, name, integrationName); + } + + /// + /// Register Token usage + /// + /// Thrown when fails to make API call + /// + /// + /// + /// ApiResponse of Object(void) + public ApiResponse RegisterTokenUsageWithHttpInfo(int? body, string name, string integrationName) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->RegisterTokenUsage"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->RegisterTokenUsage"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->RegisterTokenUsage"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}/metrics"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("RegisterTokenUsage", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Register Token usage + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Task of void + public async System.Threading.Tasks.Task RegisterTokenUsageAsync(int? body, string name, string integrationName) + { + await RegisterTokenUsageAsyncWithHttpInfo(body, name, integrationName); + + } + + /// + /// Register Token usage + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> RegisterTokenUsageAsyncWithHttpInfo(int? body, string name, string integrationName) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->RegisterTokenUsage"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->RegisterTokenUsage"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->RegisterTokenUsage"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}/metrics"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("RegisterTokenUsage", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Create or Update Integration + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + public void SaveIntegrationApi(IntegrationApiUpdate body, string name, string integrationName) + { + SaveIntegrationApiWithHttpInfo(body, name, integrationName); + } + + /// + /// Create or Update Integration + /// + /// Thrown when fails to make API call + /// + /// + /// + /// ApiResponse of Object(void) + public ApiResponse SaveIntegrationApiWithHttpInfo(IntegrationApiUpdate body, string name, string integrationName) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->SaveIntegrationApi"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->SaveIntegrationApi"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->SaveIntegrationApi"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("SaveIntegrationApi", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Create or Update Integration + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Task of void + public async System.Threading.Tasks.Task SaveIntegrationApiAsync(IntegrationApiUpdate body, string name, string integrationName) + { + await SaveIntegrationApiAsyncWithHttpInfo(body, name, integrationName); + + } + + /// + /// Create or Update Integration + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> SaveIntegrationApiAsyncWithHttpInfo(IntegrationApiUpdate body, string name, string integrationName) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->SaveIntegrationApi"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->SaveIntegrationApi"); + // verify the required parameter 'integrationName' is set + if (integrationName == null) + throw new ApiException(400, "Missing required parameter 'integrationName' when calling IntegrationResourceApi->SaveIntegrationApi"); + + var localVarPath = "/integrations/provider/{name}/integration/{integration_name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (integrationName != null) localVarPathParams.Add("integration_name", this.Configuration.ApiClient.ParameterToString(integrationName)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("SaveIntegrationApi", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Create or Update Integration provider + /// + /// Thrown when fails to make API call + /// + /// + /// + public void SaveIntegrationProvider(IntegrationUpdate body, string name) + { + SaveIntegrationProviderWithHttpInfo(body, name); + } + + /// + /// Create or Update Integration provider + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + public ApiResponse SaveIntegrationProviderWithHttpInfo(IntegrationUpdate body, string name) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->SaveIntegrationProvider"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->SaveIntegrationProvider"); + + var localVarPath = "/integrations/provider/{name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("SaveIntegrationProvider", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Create or Update Integration provider + /// + /// Thrown when fails to make API call + /// + /// + /// Task of void + public async System.Threading.Tasks.Task SaveIntegrationProviderAsync(IntegrationUpdate body, string name) + { + await SaveIntegrationProviderAsyncWithHttpInfo(body, name); + + } + + /// + /// Create or Update Integration provider + /// + /// Thrown when fails to make API call + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> SaveIntegrationProviderAsyncWithHttpInfo(IntegrationUpdate body, string name) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling IntegrationResourceApi->SaveIntegrationProvider"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling IntegrationResourceApi->SaveIntegrationProvider"); + + var localVarPath = "/integrations/provider/{name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("SaveIntegrationProvider", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + } +} diff --git a/Conductor/Api/PromptResourceApi.cs b/Conductor/Api/PromptResourceApi.cs new file mode 100644 index 00000000..bde0d437 --- /dev/null +++ b/Conductor/Api/PromptResourceApi.cs @@ -0,0 +1,1257 @@ +using Conductor.Client; +using Conductor.Client.Models; +using conductor_csharp.Api; +using RestSharp; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Conductor.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class PromptResourceApi : IPromptResourceApi + { + private ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public PromptResourceApi(string basePath) + { + this.Configuration = new Conductor.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// + /// + public PromptResourceApi() + { + this.Configuration = Conductor.Client.Configuration.Default; + + ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public PromptResourceApi(Conductor.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = Conductor.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.ApiClient.RestClient.Options.BaseUrl.ToString(); + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Conductor.Client.Configuration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Conductor.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Delete Template + /// + /// Thrown when fails to make API call + /// + /// + public void DeleteMessageTemplate(string name) + { + DeleteMessageTemplateWithHttpInfo(name); + } + + /// + /// Delete Template + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + public ApiResponse DeleteMessageTemplateWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling PromptResourceApi->DeleteMessageTemplate"); + + var localVarPath = "/prompts/{name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteMessageTemplate", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Delete Template + /// + /// Thrown when fails to make API call + /// + /// Task of void + public async System.Threading.Tasks.Task DeleteMessageTemplateAsync(string name) + { + await DeleteMessageTemplateAsyncWithHttpInfo(name); + + } + + /// + /// Delete Template + /// + /// Thrown when fails to make API call + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteMessageTemplateAsyncWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling PromptResourceApi->DeleteMessageTemplate"); + + var localVarPath = "/prompts/{name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteMessageTemplate", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Delete a tag for Prompt Template + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the Prompt the tag should be deleted from. + /// + public void DeleteTagForPromptTemplate(List body, string name) + { + DeleteTagForPromptTemplateWithHttpInfo(body, name); + } + + /// + /// Delete a tag for Prompt Template + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the Prompt the tag should be deleted from. + /// ApiResponse of Object(void) + public ApiResponse DeleteTagForPromptTemplateWithHttpInfo(List body, string name) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PromptResourceApi->DeleteTagForPromptTemplate"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling PromptResourceApi->DeleteTagForPromptTemplate"); + + var localVarPath = "/prompts/{name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteTagForPromptTemplate", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Delete a tag for Prompt Template + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the Prompt the tag should be deleted from. + /// Task of void + public async System.Threading.Tasks.Task DeleteTagForPromptTemplateAsync(List body, string name) + { + await DeleteTagForPromptTemplateAsyncWithHttpInfo(body, name); + + } + + /// + /// Delete a tag for Prompt Template + /// + /// Thrown when fails to make API call + /// The list of tags to be deleted. + /// The name of the Prompt the tag should be deleted from. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteTagForPromptTemplateAsyncWithHttpInfo(List body, string name) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PromptResourceApi->DeleteTagForPromptTemplate"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling PromptResourceApi->DeleteTagForPromptTemplate"); + + var localVarPath = "/prompts/{name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteTagForPromptTemplate", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Get Template + /// + /// Thrown when fails to make API call + /// + /// MessageTemplate + public MessageTemplate GetMessageTemplate(string name) + { + ApiResponse localVarResponse = GetMessageTemplateWithHttpInfo(name); + return localVarResponse.Data; + } + + /// + /// Get Template + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of MessageTemplate + public ApiResponse GetMessageTemplateWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling PromptResourceApi->GetMessageTemplate"); + + var localVarPath = "/prompts/{name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetMessageTemplate", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (MessageTemplate)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(MessageTemplate))); + } + + /// + /// Get Template + /// + /// Thrown when fails to make API call + /// + /// Task of MessageTemplate + public async System.Threading.Tasks.Task GetMessageTemplateAsync(string name) + { + ApiResponse localVarResponse = await GetMessageTemplateAsyncWithHttpInfo(name); + return localVarResponse.Data; + + } + + /// + /// Get Template + /// + /// Thrown when fails to make API call + /// + /// Task of ApiResponse (MessageTemplate) + public async System.Threading.Tasks.Task> GetMessageTemplateAsyncWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling PromptResourceApi->GetMessageTemplate"); + + var localVarPath = "/prompts/{name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetMessageTemplate", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (MessageTemplate)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(MessageTemplate))); + } + + /// + /// Get Templates + /// + /// Thrown when fails to make API call + /// List + public List GetMessageTemplates() + { + ApiResponse> localVarResponse = GetMessageTemplatesWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get Templates + /// + /// Thrown when fails to make API call + /// ApiResponse of List + public ApiResponse> GetMessageTemplatesWithHttpInfo() + { + + var localVarPath = "/prompts"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetMessageTemplates", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get Templates + /// + /// Thrown when fails to make API call + /// Task of List + public async System.Threading.Tasks.Task> GetMessageTemplatesAsync() + { + ApiResponse> localVarResponse = await GetMessageTemplatesAsyncWithHttpInfo(); + return localVarResponse.Data; + + } + + /// + /// Get Templates + /// + /// Thrown when fails to make API call + /// Task of ApiResponse (List) + public async System.Threading.Tasks.Task>> GetMessageTemplatesAsyncWithHttpInfo() + { + + var localVarPath = "/prompts"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetMessageTemplates", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get tags by Prompt Template + /// + /// Thrown when fails to make API call + /// + /// List + public List GetTagsForPromptTemplate(string name) + { + ApiResponse> localVarResponse = GetTagsForPromptTemplateWithHttpInfo(name); + return localVarResponse.Data; + } + + /// + /// Get tags by Prompt Template + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List + public ApiResponse> GetTagsForPromptTemplateWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling PromptResourceApi->GetTagsForPromptTemplate"); + + var localVarPath = "/prompts/{name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetTagsForPromptTemplate", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Get tags by Prompt Template + /// + /// Thrown when fails to make API call + /// + /// Task of List + public async System.Threading.Tasks.Task> GetTagsForPromptTemplateAsync(string name) + { + ApiResponse> localVarResponse = await GetTagsForPromptTemplateAsyncWithHttpInfo(name); + return localVarResponse.Data; + + } + + /// + /// Get tags by Prompt Template + /// + /// Thrown when fails to make API call + /// + /// Task of ApiResponse (List) + public async System.Threading.Tasks.Task>> GetTagsForPromptTemplateAsyncWithHttpInfo(string name) + { + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling PromptResourceApi->GetTagsForPromptTemplate"); + + var localVarPath = "/prompts/{name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetTagsForPromptTemplate", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (List)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Put a tag to Prompt Template + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the Prompt the tag should be updated with. + /// + public void PutTagForPromptTemplate(List body, string name) + { + PutTagForPromptTemplateWithHttpInfo(body, name); + } + + /// + /// Put a tag to Prompt Template + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the Prompt the tag should be updated with. + /// ApiResponse of Object(void) + public ApiResponse PutTagForPromptTemplateWithHttpInfo(List body, string name) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PromptResourceApi->PutTagForPromptTemplate"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling PromptResourceApi->PutTagForPromptTemplate"); + + var localVarPath = "/prompts/{name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("PutTagForPromptTemplate", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Put a tag to Prompt Template + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the Prompt the tag should be updated with. + /// Task of void + public async System.Threading.Tasks.Task PutTagForPromptTemplateAsync(List body, string name) + { + await PutTagForPromptTemplateAsyncWithHttpInfo(body, name); + + } + + /// + /// Put a tag to Prompt Template + /// + /// Thrown when fails to make API call + /// The list of tags to be updated. + /// The name of the Prompt the tag should be updated with. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> PutTagForPromptTemplateAsyncWithHttpInfo(List body, string name) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PromptResourceApi->PutTagForPromptTemplate"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling PromptResourceApi->PutTagForPromptTemplate"); + + var localVarPath = "/prompts/{name}/tags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("PutTagForPromptTemplate", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Create or Update Template + /// + /// Thrown when fails to make API call + /// + /// + /// + /// (optional) + /// + public void SaveMessageTemplate(string body, string description, string name, List models = null) + { + SaveMessageTemplateWithHttpInfo(body, description, name, models); + } + + /// + /// Create or Update Template + /// + /// Thrown when fails to make API call + /// + /// + /// + /// (optional) + /// ApiResponse of Object(void) + public ApiResponse SaveMessageTemplateWithHttpInfo(string body, string description, string name, List models = null) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PromptResourceApi->SaveMessageTemplate"); + // verify the required parameter 'description' is set + if (description == null) + throw new ApiException(400, "Missing required parameter 'description' when calling PromptResourceApi->SaveMessageTemplate"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling PromptResourceApi->SaveMessageTemplate"); + + var localVarPath = "/prompts/{name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (description != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "description", description)); // query parameter + if (models != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "models", models)); // query parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("SaveMessageTemplate", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Create or Update Template + /// + /// Thrown when fails to make API call + /// + /// + /// + /// (optional) + /// Task of void + public async System.Threading.Tasks.Task SaveMessageTemplateAsync(string body, string description, string name, List models = null) + { + await SaveMessageTemplateAsyncWithHttpInfo(body, description, name, models); + + } + + /// + /// Create or Update Template + /// + /// Thrown when fails to make API call + /// + /// + /// + /// (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> SaveMessageTemplateAsyncWithHttpInfo(string body, string description, string name, List models = null) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PromptResourceApi->SaveMessageTemplate"); + // verify the required parameter 'description' is set + if (description == null) + throw new ApiException(400, "Missing required parameter 'description' when calling PromptResourceApi->SaveMessageTemplate"); + // verify the required parameter 'name' is set + if (name == null) + throw new ApiException(400, "Missing required parameter 'name' when calling PromptResourceApi->SaveMessageTemplate"); + + var localVarPath = "/prompts/{name}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter + if (description != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "description", description)); // query parameter + if (models != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "models", models)); // query parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("SaveMessageTemplate", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// Test Prompt Template + /// + /// Thrown when fails to make API call + /// + /// string + public string TestMessageTemplate(PromptTemplateTestRequest body) + { + ApiResponse localVarResponse = TestMessageTemplateWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test Prompt Template + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of string + public ApiResponse TestMessageTemplateWithHttpInfo(PromptTemplateTestRequest body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PromptResourceApi->TestMessageTemplate"); + + var localVarPath = "/prompts/test"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType, Configuration); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestMessageTemplate", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (string)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); + } + + /// + /// Test Prompt Template + /// + /// Thrown when fails to make API call + /// + /// Task of string + public async System.Threading.Tasks.Task TestMessageTemplateAsync(PromptTemplateTestRequest body) + { + ApiResponse localVarResponse = await TestMessageTemplateAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test Prompt Template + /// + /// Thrown when fails to make API call + /// + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> TestMessageTemplateAsyncWithHttpInfo(PromptTemplateTestRequest body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PromptResourceApi->TestMessageTemplate"); + + var localVarPath = "/prompts/test"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = new string[] { "application/json" }; + string localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { "application/json" }; + string localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + RestResponse localVarResponse = (RestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestMessageTemplate", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (string)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); + } + } +} \ No newline at end of file diff --git a/Conductor/Client/Models/EventLog.cs b/Conductor/Client/Models/EventLog.cs new file mode 100644 index 00000000..2783405e --- /dev/null +++ b/Conductor/Client/Models/EventLog.cs @@ -0,0 +1,220 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; + +namespace Conductor.Client.Models +{ + /// + /// EventLog + /// + [DataContract] + public partial class EventLog : IEquatable, IValidatableObject + { + /// + /// Defines EventType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EventTypeEnum + { + /// + /// Enum SEND for value: SEND + /// + [EnumMember(Value = "SEND")] + SEND = 1, + /// + /// Enum RECEIVE for value: RECEIVE + /// + [EnumMember(Value = "RECEIVE")] + RECEIVE = 2 + } + /// + /// Gets or Sets EventType + /// + [DataMember(Name = "eventType", EmitDefaultValue = false)] + public EventTypeEnum? EventType { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// createdAt. + /// _event. + /// eventType. + /// handlerName. + /// id. + /// taskId. + /// workerId. + public EventLog(long? createdAt = default(long?), string _event = default(string), EventTypeEnum? eventType = default(EventTypeEnum?), string handlerName = default(string), string id = default(string), string taskId = default(string), string workerId = default(string)) + { + this.CreatedAt = createdAt; + this._Event = _event; + this.EventType = eventType; + this.HandlerName = handlerName; + this.Id = id; + this.TaskId = taskId; + this.WorkerId = workerId; + } + + /// + /// Gets or Sets CreatedAt + /// + [DataMember(Name = "createdAt", EmitDefaultValue = false)] + public long? CreatedAt { get; set; } + + /// + /// Gets or Sets _Event + /// + [DataMember(Name = "event", EmitDefaultValue = false)] + public string _Event { get; set; } + + /// + /// Gets or Sets HandlerName + /// + [DataMember(Name = "handlerName", EmitDefaultValue = false)] + public string HandlerName { get; set; } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets TaskId + /// + [DataMember(Name = "taskId", EmitDefaultValue = false)] + public string TaskId { get; set; } + + /// + /// Gets or Sets WorkerId + /// + [DataMember(Name = "workerId", EmitDefaultValue = false)] + public string WorkerId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class EventLog {\n"); + sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n"); + sb.Append(" _Event: ").Append(_Event).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" HandlerName: ").Append(HandlerName).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" TaskId: ").Append(TaskId).Append("\n"); + sb.Append(" WorkerId: ").Append(WorkerId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as EventLog); + } + + /// + /// Returns true if EventLog instances are equal + /// + /// Instance of EventLog to be compared + /// Boolean + public bool Equals(EventLog input) + { + if (input == null) + return false; + + return + ( + this.CreatedAt == input.CreatedAt || + (this.CreatedAt != null && + this.CreatedAt.Equals(input.CreatedAt)) + ) && + ( + this._Event == input._Event || + (this._Event != null && + this._Event.Equals(input._Event)) + ) && + ( + this.EventType == input.EventType || + (this.EventType != null && + this.EventType.Equals(input.EventType)) + ) && + ( + this.HandlerName == input.HandlerName || + (this.HandlerName != null && + this.HandlerName.Equals(input.HandlerName)) + ) && + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.TaskId == input.TaskId || + (this.TaskId != null && + this.TaskId.Equals(input.TaskId)) + ) && + ( + this.WorkerId == input.WorkerId || + (this.WorkerId != null && + this.WorkerId.Equals(input.WorkerId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CreatedAt != null) + hashCode = hashCode * 59 + this.CreatedAt.GetHashCode(); + if (this._Event != null) + hashCode = hashCode * 59 + this._Event.GetHashCode(); + if (this.EventType != null) + hashCode = hashCode * 59 + this.EventType.GetHashCode(); + if (this.HandlerName != null) + hashCode = hashCode * 59 + this.HandlerName.GetHashCode(); + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.TaskId != null) + hashCode = hashCode * 59 + this.TaskId.GetHashCode(); + if (this.WorkerId != null) + hashCode = hashCode * 59 + this.WorkerId.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } +} diff --git a/Conductor/Client/Models/Integration.cs b/Conductor/Client/Models/Integration.cs new file mode 100644 index 00000000..ff28c446 --- /dev/null +++ b/Conductor/Client/Models/Integration.cs @@ -0,0 +1,319 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; + +namespace Conductor.Client.Models +{ + /// + /// Integration + /// + [DataContract] + public partial class Integration : IEquatable, IValidatableObject + { + /// + /// Defines Category + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum CategoryEnum + { + /// + /// Enum API for value: API + /// + [EnumMember(Value = "API")] + API = 1, + /// + /// Enum AIMODEL for value: AI_MODEL + /// + [EnumMember(Value = "AI_MODEL")] + AIMODEL = 2, + /// + /// Enum VECTORDB for value: VECTOR_DB + /// + [EnumMember(Value = "VECTOR_DB")] + VECTORDB = 3, + /// + /// Enum RELATIONALDB for value: RELATIONAL_DB + /// + [EnumMember(Value = "RELATIONAL_DB")] + RELATIONALDB = 4, + /// + /// Enum MESSAGEBROKER for value: MESSAGE_BROKER + /// + [EnumMember(Value = "MESSAGE_BROKER")] + MESSAGEBROKER = 5 + } + /// + /// Gets or Sets Category + /// + [DataMember(Name = "category", EmitDefaultValue = false)] + public CategoryEnum? Category { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// category. + /// configuration. + /// createdBy. + /// createdOn. + /// description. + /// enabled. + /// modelsCount. + /// name. + /// tags. + /// type. + /// updatedBy. + /// updatedOn. + public Integration(CategoryEnum? category = default(CategoryEnum?), Dictionary configuration = default(Dictionary), string createdBy = default(string), long? createdOn = default(long?), string description = default(string), bool? enabled = default(bool?), long? modelsCount = default(long?), string name = default(string), List tags = default(List), string type = default(string), string updatedBy = default(string), long? updatedOn = default(long?)) + { + this.Category = category; + this.Configuration = configuration; + this.CreatedBy = createdBy; + this.CreatedOn = createdOn; + this.Description = description; + this.Enabled = enabled; + this.ModelsCount = modelsCount; + this.Name = name; + this.Tags = tags; + this.Type = type; + this.UpdatedBy = updatedBy; + this.UpdatedOn = updatedOn; + } + + + /// + /// Gets or Sets Configuration + /// + [DataMember(Name = "configuration", EmitDefaultValue = false)] + public Dictionary Configuration { get; set; } + + /// + /// Gets or Sets CreatedBy + /// + [DataMember(Name = "createdBy", EmitDefaultValue = false)] + public string CreatedBy { get; set; } + + /// + /// Gets or Sets CreatedOn + /// + [DataMember(Name = "createdOn", EmitDefaultValue = false)] + public long? CreatedOn { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } + + /// + /// Gets or Sets Enabled + /// + [DataMember(Name = "enabled", EmitDefaultValue = false)] + public bool? Enabled { get; set; } + + /// + /// Gets or Sets ModelsCount + /// + [DataMember(Name = "modelsCount", EmitDefaultValue = false)] + public long? ModelsCount { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name = "tags", EmitDefaultValue = false)] + public List Tags { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } + + /// + /// Gets or Sets UpdatedBy + /// + [DataMember(Name = "updatedBy", EmitDefaultValue = false)] + public string UpdatedBy { get; set; } + + /// + /// Gets or Sets UpdatedOn + /// + [DataMember(Name = "updatedOn", EmitDefaultValue = false)] + public long? UpdatedOn { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Integration {\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Configuration: ").Append(Configuration).Append("\n"); + sb.Append(" CreatedBy: ").Append(CreatedBy).Append("\n"); + sb.Append(" CreatedOn: ").Append(CreatedOn).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Enabled: ").Append(Enabled).Append("\n"); + sb.Append(" ModelsCount: ").Append(ModelsCount).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" UpdatedBy: ").Append(UpdatedBy).Append("\n"); + sb.Append(" UpdatedOn: ").Append(UpdatedOn).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Integration); + } + + /// + /// Returns true if Integration instances are equal + /// + /// Instance of Integration to be compared + /// Boolean + public bool Equals(Integration input) + { + if (input == null) + return false; + + return + ( + this.Category == input.Category || + (this.Category != null && + this.Category.Equals(input.Category)) + ) && + ( + this.Configuration == input.Configuration || + this.Configuration != null && + input.Configuration != null && + this.Configuration.SequenceEqual(input.Configuration) + ) && + ( + this.CreatedBy == input.CreatedBy || + (this.CreatedBy != null && + this.CreatedBy.Equals(input.CreatedBy)) + ) && + ( + this.CreatedOn == input.CreatedOn || + (this.CreatedOn != null && + this.CreatedOn.Equals(input.CreatedOn)) + ) && + ( + this.Description == input.Description || + (this.Description != null && + this.Description.Equals(input.Description)) + ) && + ( + this.Enabled == input.Enabled || + (this.Enabled != null && + this.Enabled.Equals(input.Enabled)) + ) && + ( + this.ModelsCount == input.ModelsCount || + (this.ModelsCount != null && + this.ModelsCount.Equals(input.ModelsCount)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.Tags == input.Tags || + this.Tags != null && + input.Tags != null && + this.Tags.SequenceEqual(input.Tags) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ) && + ( + this.UpdatedBy == input.UpdatedBy || + (this.UpdatedBy != null && + this.UpdatedBy.Equals(input.UpdatedBy)) + ) && + ( + this.UpdatedOn == input.UpdatedOn || + (this.UpdatedOn != null && + this.UpdatedOn.Equals(input.UpdatedOn)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Category != null) + hashCode = hashCode * 59 + this.Category.GetHashCode(); + if (this.Configuration != null) + hashCode = hashCode * 59 + this.Configuration.GetHashCode(); + if (this.CreatedBy != null) + hashCode = hashCode * 59 + this.CreatedBy.GetHashCode(); + if (this.CreatedOn != null) + hashCode = hashCode * 59 + this.CreatedOn.GetHashCode(); + if (this.Description != null) + hashCode = hashCode * 59 + this.Description.GetHashCode(); + if (this.Enabled != null) + hashCode = hashCode * 59 + this.Enabled.GetHashCode(); + if (this.ModelsCount != null) + hashCode = hashCode * 59 + this.ModelsCount.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + if (this.Tags != null) + hashCode = hashCode * 59 + this.Tags.GetHashCode(); + if (this.Type != null) + hashCode = hashCode * 59 + this.Type.GetHashCode(); + if (this.UpdatedBy != null) + hashCode = hashCode * 59 + this.UpdatedBy.GetHashCode(); + if (this.UpdatedOn != null) + hashCode = hashCode * 59 + this.UpdatedOn.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } +} diff --git a/Conductor/Client/Models/IntegrationApi.cs b/Conductor/Client/Models/IntegrationApi.cs new file mode 100644 index 00000000..25685e92 --- /dev/null +++ b/Conductor/Client/Models/IntegrationApi.cs @@ -0,0 +1,253 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; + +namespace Conductor.Client.Models +{ + /// + /// IntegrationApi + /// + [DataContract] + public partial class IntegrationApi : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// api. + /// configuration. + /// createdBy. + /// createdOn. + /// description. + /// enabled. + /// integrationName. + /// tags. + /// updatedBy. + /// updatedOn. + public IntegrationApi(string api = default(string), Dictionary configuration = default(Dictionary), string createdBy = default(string), long? createdOn = default(long?), string description = default(string), bool? enabled = default(bool?), string integrationName = default(string), List tags = default(List), string updatedBy = default(string), long? updatedOn = default(long?)) + { + this.Api = api; + this.Configuration = configuration; + this.CreatedBy = createdBy; + this.CreatedOn = createdOn; + this.Description = description; + this.Enabled = enabled; + this.IntegrationName = integrationName; + this.Tags = tags; + this.UpdatedBy = updatedBy; + this.UpdatedOn = updatedOn; + } + + /// + /// Gets or Sets Api + /// + [DataMember(Name = "api", EmitDefaultValue = false)] + public string Api { get; set; } + + /// + /// Gets or Sets Configuration + /// + [DataMember(Name = "configuration", EmitDefaultValue = false)] + public Dictionary Configuration { get; set; } + + /// + /// Gets or Sets CreatedBy + /// + [DataMember(Name = "createdBy", EmitDefaultValue = false)] + public string CreatedBy { get; set; } + + /// + /// Gets or Sets CreatedOn + /// + [DataMember(Name = "createdOn", EmitDefaultValue = false)] + public long? CreatedOn { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } + + /// + /// Gets or Sets Enabled + /// + [DataMember(Name = "enabled", EmitDefaultValue = false)] + public bool? Enabled { get; set; } + + /// + /// Gets or Sets IntegrationName + /// + [DataMember(Name = "integrationName", EmitDefaultValue = false)] + public string IntegrationName { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name = "tags", EmitDefaultValue = false)] + public List Tags { get; set; } + + /// + /// Gets or Sets UpdatedBy + /// + [DataMember(Name = "updatedBy", EmitDefaultValue = false)] + public string UpdatedBy { get; set; } + + /// + /// Gets or Sets UpdatedOn + /// + [DataMember(Name = "updatedOn", EmitDefaultValue = false)] + public long? UpdatedOn { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class IntegrationApi {\n"); + sb.Append(" Api: ").Append(Api).Append("\n"); + sb.Append(" Configuration: ").Append(Configuration).Append("\n"); + sb.Append(" CreatedBy: ").Append(CreatedBy).Append("\n"); + sb.Append(" CreatedOn: ").Append(CreatedOn).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Enabled: ").Append(Enabled).Append("\n"); + sb.Append(" IntegrationName: ").Append(IntegrationName).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" UpdatedBy: ").Append(UpdatedBy).Append("\n"); + sb.Append(" UpdatedOn: ").Append(UpdatedOn).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as IntegrationApi); + } + + /// + /// Returns true if IntegrationApi instances are equal + /// + /// Instance of IntegrationApi to be compared + /// Boolean + public bool Equals(IntegrationApi input) + { + if (input == null) + return false; + + return + ( + this.Api == input.Api || + (this.Api != null && + this.Api.Equals(input.Api)) + ) && + ( + this.Configuration == input.Configuration || + this.Configuration != null && + input.Configuration != null && + this.Configuration.SequenceEqual(input.Configuration) + ) && + ( + this.CreatedBy == input.CreatedBy || + (this.CreatedBy != null && + this.CreatedBy.Equals(input.CreatedBy)) + ) && + ( + this.CreatedOn == input.CreatedOn || + (this.CreatedOn != null && + this.CreatedOn.Equals(input.CreatedOn)) + ) && + ( + this.Description == input.Description || + (this.Description != null && + this.Description.Equals(input.Description)) + ) && + ( + this.Enabled == input.Enabled || + (this.Enabled != null && + this.Enabled.Equals(input.Enabled)) + ) && + ( + this.IntegrationName == input.IntegrationName || + (this.IntegrationName != null && + this.IntegrationName.Equals(input.IntegrationName)) + ) && + ( + this.Tags == input.Tags || + this.Tags != null && + input.Tags != null && + this.Tags.SequenceEqual(input.Tags) + ) && + ( + this.UpdatedBy == input.UpdatedBy || + (this.UpdatedBy != null && + this.UpdatedBy.Equals(input.UpdatedBy)) + ) && + ( + this.UpdatedOn == input.UpdatedOn || + (this.UpdatedOn != null && + this.UpdatedOn.Equals(input.UpdatedOn)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Api != null) + hashCode = hashCode * 59 + this.Api.GetHashCode(); + if (this.Configuration != null) + hashCode = hashCode * 59 + this.Configuration.GetHashCode(); + if (this.CreatedBy != null) + hashCode = hashCode * 59 + this.CreatedBy.GetHashCode(); + if (this.CreatedOn != null) + hashCode = hashCode * 59 + this.CreatedOn.GetHashCode(); + if (this.Description != null) + hashCode = hashCode * 59 + this.Description.GetHashCode(); + if (this.Enabled != null) + hashCode = hashCode * 59 + this.Enabled.GetHashCode(); + if (this.IntegrationName != null) + hashCode = hashCode * 59 + this.IntegrationName.GetHashCode(); + if (this.Tags != null) + hashCode = hashCode * 59 + this.Tags.GetHashCode(); + if (this.UpdatedBy != null) + hashCode = hashCode * 59 + this.UpdatedBy.GetHashCode(); + if (this.UpdatedOn != null) + hashCode = hashCode * 59 + this.UpdatedOn.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } +} diff --git a/Conductor/Client/Models/IntegrationApiUpdate.cs b/Conductor/Client/Models/IntegrationApiUpdate.cs new file mode 100644 index 00000000..b3e75cf2 --- /dev/null +++ b/Conductor/Client/Models/IntegrationApiUpdate.cs @@ -0,0 +1,140 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; + +namespace Conductor.Client.Models +{ + /// + /// IntegrationApiUpdate + /// + [DataContract] + public partial class IntegrationApiUpdate : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// configuration. + /// description. + /// enabled. + public IntegrationApiUpdate(Dictionary configuration = default(Dictionary), string description = default(string), bool? enabled = default(bool?)) + { + this.Configuration = configuration; + this.Description = description; + this.Enabled = enabled; + } + + /// + /// Gets or Sets Configuration + /// + [DataMember(Name = "configuration", EmitDefaultValue = false)] + public Dictionary Configuration { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } + + /// + /// Gets or Sets Enabled + /// + [DataMember(Name = "enabled", EmitDefaultValue = false)] + public bool? Enabled { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class IntegrationApiUpdate {\n"); + sb.Append(" Configuration: ").Append(Configuration).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Enabled: ").Append(Enabled).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as IntegrationApiUpdate); + } + + /// + /// Returns true if IntegrationApiUpdate instances are equal + /// + /// Instance of IntegrationApiUpdate to be compared + /// Boolean + public bool Equals(IntegrationApiUpdate input) + { + if (input == null) + return false; + + return + ( + this.Configuration == input.Configuration || + this.Configuration != null && + input.Configuration != null && + this.Configuration.SequenceEqual(input.Configuration) + ) && + ( + this.Description == input.Description || + (this.Description != null && + this.Description.Equals(input.Description)) + ) && + ( + this.Enabled == input.Enabled || + (this.Enabled != null && + this.Enabled.Equals(input.Enabled)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Configuration != null) + hashCode = hashCode * 59 + this.Configuration.GetHashCode(); + if (this.Description != null) + hashCode = hashCode * 59 + this.Description.GetHashCode(); + if (this.Enabled != null) + hashCode = hashCode * 59 + this.Enabled.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } +} diff --git a/Conductor/Client/Models/IntegrationDef.cs b/Conductor/Client/Models/IntegrationDef.cs new file mode 100644 index 00000000..d3ff48a1 --- /dev/null +++ b/Conductor/Client/Models/IntegrationDef.cs @@ -0,0 +1,271 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; + +namespace Conductor.Client.Models +{ + /// + /// IntegrationDef + /// + [DataContract] + public partial class IntegrationDef : IEquatable, IValidatableObject + { + /// + /// Defines Category + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum CategoryEnum + { + /// + /// Enum API for value: API + /// + [EnumMember(Value = "API")] + API = 1, + /// + /// Enum AIMODEL for value: AI_MODEL + /// + [EnumMember(Value = "AI_MODEL")] + AIMODEL = 2, + /// + /// Enum VECTORDB for value: VECTOR_DB + /// + [EnumMember(Value = "VECTOR_DB")] + VECTORDB = 3, + /// + /// Enum RELATIONALDB for value: RELATIONAL_DB + /// + [EnumMember(Value = "RELATIONAL_DB")] + RELATIONALDB = 4, + /// + /// Enum MESSAGEBROKER for value: MESSAGE_BROKER + /// + [EnumMember(Value = "MESSAGE_BROKER")] + MESSAGEBROKER = 5 + } + /// + /// Gets or Sets Category + /// + [DataMember(Name = "category", EmitDefaultValue = false)] + public CategoryEnum? Category { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// category. + /// categoryLabel. + /// configuration. + /// description. + /// enabled. + /// iconName. + /// name. + /// tags. + /// type. + public IntegrationDef(CategoryEnum? category = default(CategoryEnum?), string categoryLabel = default(string), List configuration = default(List), string description = default(string), bool? enabled = default(bool?), string iconName = default(string), string name = default(string), List tags = default(List), string type = default(string)) + { + this.Category = category; + this.CategoryLabel = categoryLabel; + this.Configuration = configuration; + this.Description = description; + this.Enabled = enabled; + this.IconName = iconName; + this.Name = name; + this.Tags = tags; + this.Type = type; + } + + + /// + /// Gets or Sets CategoryLabel + /// + [DataMember(Name = "categoryLabel", EmitDefaultValue = false)] + public string CategoryLabel { get; set; } + + /// + /// Gets or Sets Configuration + /// + [DataMember(Name = "configuration", EmitDefaultValue = false)] + public List Configuration { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } + + /// + /// Gets or Sets Enabled + /// + [DataMember(Name = "enabled", EmitDefaultValue = false)] + public bool? Enabled { get; set; } + + /// + /// Gets or Sets IconName + /// + [DataMember(Name = "iconName", EmitDefaultValue = false)] + public string IconName { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name = "tags", EmitDefaultValue = false)] + public List Tags { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class IntegrationDef {\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" CategoryLabel: ").Append(CategoryLabel).Append("\n"); + sb.Append(" Configuration: ").Append(Configuration).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Enabled: ").Append(Enabled).Append("\n"); + sb.Append(" IconName: ").Append(IconName).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as IntegrationDef); + } + + /// + /// Returns true if IntegrationDef instances are equal + /// + /// Instance of IntegrationDef to be compared + /// Boolean + public bool Equals(IntegrationDef input) + { + if (input == null) + return false; + + return + ( + this.Category == input.Category || + (this.Category != null && + this.Category.Equals(input.Category)) + ) && + ( + this.CategoryLabel == input.CategoryLabel || + (this.CategoryLabel != null && + this.CategoryLabel.Equals(input.CategoryLabel)) + ) && + ( + this.Configuration == input.Configuration || + this.Configuration != null && + input.Configuration != null && + this.Configuration.SequenceEqual(input.Configuration) + ) && + ( + this.Description == input.Description || + (this.Description != null && + this.Description.Equals(input.Description)) + ) && + ( + this.Enabled == input.Enabled || + (this.Enabled != null && + this.Enabled.Equals(input.Enabled)) + ) && + ( + this.IconName == input.IconName || + (this.IconName != null && + this.IconName.Equals(input.IconName)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.Tags == input.Tags || + this.Tags != null && + input.Tags != null && + this.Tags.SequenceEqual(input.Tags) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Category != null) + hashCode = hashCode * 59 + this.Category.GetHashCode(); + if (this.CategoryLabel != null) + hashCode = hashCode * 59 + this.CategoryLabel.GetHashCode(); + if (this.Configuration != null) + hashCode = hashCode * 59 + this.Configuration.GetHashCode(); + if (this.Description != null) + hashCode = hashCode * 59 + this.Description.GetHashCode(); + if (this.Enabled != null) + hashCode = hashCode * 59 + this.Enabled.GetHashCode(); + if (this.IconName != null) + hashCode = hashCode * 59 + this.IconName.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + if (this.Tags != null) + hashCode = hashCode * 59 + this.Tags.GetHashCode(); + if (this.Type != null) + hashCode = hashCode * 59 + this.Type.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } +} diff --git a/Conductor/Client/Models/IntegrationDefFormField.cs b/Conductor/Client/Models/IntegrationDefFormField.cs new file mode 100644 index 00000000..715739fa --- /dev/null +++ b/Conductor/Client/Models/IntegrationDefFormField.cs @@ -0,0 +1,371 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; + +namespace Conductor.Client.Models +{ + /// + /// IntegrationDefFormField + /// + [DataContract] + public partial class IntegrationDefFormField : IEquatable, IValidatableObject + { + /// + /// Defines FieldName + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum FieldNameEnum + { + /// + /// Enum Apikey for value: api_key + /// + [EnumMember(Value = "api_key")] + Apikey = 1, + /// + /// Enum User for value: user + /// + [EnumMember(Value = "user")] + User = 2, + /// + /// Enum Endpoint for value: endpoint + /// + [EnumMember(Value = "endpoint")] + Endpoint = 3, + /// + /// Enum Environment for value: environment + /// + [EnumMember(Value = "environment")] + Environment = 4, + /// + /// Enum ProjectName for value: projectName + /// + [EnumMember(Value = "projectName")] + ProjectName = 5, + /// + /// Enum IndexName for value: indexName + /// + [EnumMember(Value = "indexName")] + IndexName = 6, + /// + /// Enum Publisher for value: publisher + /// + [EnumMember(Value = "publisher")] + Publisher = 7, + /// + /// Enum Password for value: password + /// + [EnumMember(Value = "password")] + Password = 8, + /// + /// Enum Namespace for value: namespace + /// + [EnumMember(Value = "namespace")] + Namespace = 9, + /// + /// Enum BatchSize for value: batchSize + /// + [EnumMember(Value = "batchSize")] + BatchSize = 10, + /// + /// Enum BatchWaitTime for value: batchWaitTime + /// + [EnumMember(Value = "batchWaitTime")] + BatchWaitTime = 11, + /// + /// Enum VisibilityTimeout for value: visibilityTimeout + /// + [EnumMember(Value = "visibilityTimeout")] + VisibilityTimeout = 12, + /// + /// Enum ConnectionType for value: connectionType + /// + [EnumMember(Value = "connectionType")] + ConnectionType = 13, + /// + /// Enum Region for value: region + /// + [EnumMember(Value = "region")] + Region = 14, + /// + /// Enum AwsAccountId for value: awsAccountId + /// + [EnumMember(Value = "awsAccountId")] + AwsAccountId = 15, + /// + /// Enum ExternalId for value: externalId + /// + [EnumMember(Value = "externalId")] + ExternalId = 16, + /// + /// Enum RoleArn for value: roleArn + /// + [EnumMember(Value = "roleArn")] + RoleArn = 17, + /// + /// Enum Protocol for value: protocol + /// + [EnumMember(Value = "protocol")] + Protocol = 18, + /// + /// Enum Port for value: port + /// + [EnumMember(Value = "port")] + Port = 19, + /// + /// Enum SchemaRegistryUrl for value: schemaRegistryUrl + /// + [EnumMember(Value = "schemaRegistryUrl")] + SchemaRegistryUrl = 20, + /// + /// Enum SchemaRegistryApiKey for value: schemaRegistryApiKey + /// + [EnumMember(Value = "schemaRegistryApiKey")] + SchemaRegistryApiKey = 21, + /// + /// Enum SchemaRegistryApiSecret for value: schemaRegistryApiSecret + /// + [EnumMember(Value = "schemaRegistryApiSecret")] + SchemaRegistryApiSecret = 22, + /// + /// Enum AuthenticationType for value: authenticationType + /// + [EnumMember(Value = "authenticationType")] + AuthenticationType = 23, + /// + /// Enum KeyStorePassword for value: keyStorePassword + /// + [EnumMember(Value = "keyStorePassword")] + KeyStorePassword = 24, + /// + /// Enum KeyStoreLocation for value: keyStoreLocation + /// + [EnumMember(Value = "keyStoreLocation")] + KeyStoreLocation = 25, + /// + /// Enum SchemaRegistryAuthType for value: schemaRegistryAuthType + /// + [EnumMember(Value = "schemaRegistryAuthType")] + SchemaRegistryAuthType = 26, + /// + /// Enum ValueSubjectNameStrategy for value: valueSubjectNameStrategy + /// + [EnumMember(Value = "valueSubjectNameStrategy")] + ValueSubjectNameStrategy = 27 + } + + /// + /// Gets or Sets FieldName + /// + [DataMember(Name = "fieldName", EmitDefaultValue = false)] + public FieldNameEnum? FieldName { get; set; } + + /// + /// Defines FieldType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum FieldTypeEnum + { + /// + /// Enum DROPDOWN for value: DROPDOWN + /// + [EnumMember(Value = "DROPDOWN")] + DROPDOWN = 1, + /// + /// Enum TEXT for value: TEXT + /// + [EnumMember(Value = "TEXT")] + TEXT = 2, + /// + /// Enum PASSWORD for value: PASSWORD + /// + [EnumMember(Value = "PASSWORD")] + PASSWORD = 3 + } + + /// + /// Gets or Sets FieldType + /// + [DataMember(Name = "fieldType", EmitDefaultValue = false)] + public FieldTypeEnum? FieldType { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// defaultValue. + /// description. + /// fieldName. + /// fieldType. + /// label. + /// value. + /// valueOptions. + public IntegrationDefFormField(string defaultValue = default(string), string description = default(string), FieldNameEnum? fieldName = default(FieldNameEnum?), FieldTypeEnum? fieldType = default(FieldTypeEnum?), string label = default(string), string value = default(string), List