From f8c1fa6b9592b24fe932b4f5a247e00094e0bf01 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Tue, 30 Jan 2024 09:44:42 -0800 Subject: [PATCH 1/4] separate interfaces and add idempotency --- Conductor/Api/IWorkflowResourceApi.cs | 677 +++++++++++++ Conductor/Api/WorkflowResourceApi.cs | 912 ++---------------- .../Client/Models/IdempotencyStrategy.cs | 15 + .../Client/Models/StartWorkflowRequest.cs | 26 +- 4 files changed, 765 insertions(+), 865 deletions(-) create mode 100644 Conductor/Api/IWorkflowResourceApi.cs create mode 100644 Conductor/Client/Models/IdempotencyStrategy.cs diff --git a/Conductor/Api/IWorkflowResourceApi.cs b/Conductor/Api/IWorkflowResourceApi.cs new file mode 100644 index 00000000..9fb1468e --- /dev/null +++ b/Conductor/Api/IWorkflowResourceApi.cs @@ -0,0 +1,677 @@ +using System; +using System.Collections.Generic; +using Conductor.Client; +using Conductor.Client.Models; + +namespace Conductor.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IWorkflowResourceApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Starts the decision task for a workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + void Decide(string workflowId); + + /// + /// Starts the decision task for a workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + ApiResponse DecideWithHttpInfo(string workflowId); + /// + /// Removes the workflow from the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// + void Delete(string workflowId, bool? archiveWorkflow = null); + + /// + /// Removes the workflow from the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// ApiResponse of Object(void) + ApiResponse DeleteWithHttpInfo(string workflowId, bool? archiveWorkflow = null); + /// + /// Execute a workflow synchronously + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// (optional) + /// WorkflowRun + WorkflowRun ExecuteWorkflow(StartWorkflowRequest body, string requestId, string name, int? version, string waitUntilTaskRef = null); + + /// + /// Update the value of the workflow variables for the given workflow id + /// + /// + /// ApiResponse of Object(void) + Object UpdateWorkflowVariables(Workflow workflow); + /// + /// Execute a workflow synchronously + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// (optional) + /// ApiResponse of WorkflowRun + ApiResponse ExecuteWorkflowWithHttpInfo(StartWorkflowRequest body, string requestId, string name, int? version, string waitUntilTaskRef = null); + /// + /// Gets the workflow by workflow id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// (optional, default to false) + /// Workflow + Workflow GetExecutionStatus(string workflowId, bool? includeTasks = null, bool? summarize = null); + + /// + /// Gets the workflow by workflow id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// (optional, default to false) + /// ApiResponse of Workflow + ApiResponse GetExecutionStatusWithHttpInfo(string workflowId, bool? includeTasks = null, bool? summarize = null); + /// + /// Gets the workflow tasks by workflow id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to 0) + /// (optional, default to 15) + /// (optional) + /// TaskListSearchResultSummary + TaskListSearchResultSummary GetExecutionStatusTaskList(string workflowId, int? start = null, int? count = null, string status = null); + + /// + /// Gets the workflow tasks by workflow id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to 0) + /// (optional, default to 15) + /// (optional) + /// ApiResponse of TaskListSearchResultSummary + ApiResponse GetExecutionStatusTaskListWithHttpInfo(string workflowId, int? start = null, int? count = null, string status = null); + /// + /// Get the uri and path of the external storage where the workflow payload is to be stored + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// ExternalStorageLocation + ExternalStorageLocation GetExternalStorageLocation(string path, string operation, string payloadType); + + /// + /// Get the uri and path of the external storage where the workflow payload is to be stored + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// ApiResponse of ExternalStorageLocation + ApiResponse GetExternalStorageLocationWithHttpInfo(string path, string operation, string payloadType); + /// + /// Retrieve all the running workflows + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to 1) + /// (optional) + /// (optional) + /// List<string> + List GetRunningWorkflow(string name, int? version = null, long? startTime = null, long? endTime = null); + + /// + /// Retrieve all the running workflows + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to 1) + /// (optional) + /// (optional) + /// ApiResponse of List<string> + ApiResponse> GetRunningWorkflowWithHttpInfo(string name, int? version = null, long? startTime = null, long? endTime = null); + /// + /// Gets the workflow by workflow id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to false) + /// (optional, default to false) + /// WorkflowStatus + WorkflowStatus GetWorkflowStatusSummary(string workflowId, bool? includeOutput = null, bool? includeVariables = null); + + /// + /// Gets the workflow by workflow id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to false) + /// (optional, default to false) + /// ApiResponse of WorkflowStatus + ApiResponse GetWorkflowStatusSummaryWithHttpInfo(string workflowId, bool? includeOutput = null, bool? includeVariables = null); + /// + /// Lists workflows for the given correlation id list + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// (optional, default to false) + /// (optional, default to false) + /// Dictionary<string, List<Workflow>> + Dictionary> GetWorkflows(List correlationIds, string name, bool? includeClosed = null, bool? includeTasks = null); + + /// + /// Lists workflows for the given correlation id list + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// (optional, default to false) + /// (optional, default to false) + /// ApiResponse of Dictionary<string, List<Workflow>> + ApiResponse>> GetWorkflowsWithHttpInfo(List correlationIds, string name, bool? includeClosed = null, bool? includeTasks = null); + /// + /// Lists workflows for the given correlation id list and workflow name list + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to false) + /// (optional, default to false) + /// Dictionary<string, List<Workflow>> + Dictionary> GetWorkflows(CorrelationIdsSearchRequest request, bool? includeClosed = null, bool? includeTasks = null); + + /// + /// Lists workflows for the given correlation id list and workflow name list + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to false) + /// (optional, default to false) + /// ApiResponse of Dictionary<string, List<Workflow>> + ApiResponse>> GetWorkflowsWithHttpInfo(CorrelationIdsSearchRequest request, bool? includeClosed = null, bool? includeTasks = null); + /// + /// Lists workflows for the given correlation id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// (optional, default to false) + /// (optional, default to false) + /// List<Workflow> + List GetWorkflows(string name, string correlationId, bool? includeClosed = null, bool? includeTasks = null); + + /// + /// Lists workflows for the given correlation id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// (optional, default to false) + /// (optional, default to false) + /// ApiResponse of List<Workflow> + ApiResponse> GetWorkflowsWithHttpInfo(string name, string correlationId, bool? includeClosed = null, bool? includeTasks = null); + /// + /// Pauses the workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + void PauseWorkflow(string workflowId); + + /// + /// Pauses the workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + ApiResponse PauseWorkflowWithHttpInfo(string workflowId); + + /// + /// Reruns the workflow from a specific task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// string + string Rerun(RerunWorkflowRequest request, string workflowId); + + /// + /// Reruns the workflow from a specific task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of string + ApiResponse RerunWithHttpInfo(RerunWorkflowRequest request, string workflowId); + /// + /// Resets callback times of all non-terminal SIMPLE tasks to 0 + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + void ResetWorkflow(string workflowId); + + /// + /// Resets callback times of all non-terminal SIMPLE tasks to 0 + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + ApiResponse ResetWorkflowWithHttpInfo(string workflowId); + /// + /// Restarts a completed workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to false) + /// + void Restart(string workflowId, bool? useLatestDefinitions = null); + + /// + /// Restarts a completed workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to false) + /// ApiResponse of Object(void) + ApiResponse RestartWithHttpInfo(string workflowId, bool? useLatestDefinitions = null); + /// + /// Resumes the workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + void ResumeWorkflow(string workflowId); + + /// + /// Resumes the workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + ApiResponse ResumeWorkflowWithHttpInfo(string workflowId); + /// + /// Retries the last failed task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to false) + /// + void Retry(string workflowId, bool? resumeSubworkflowTasks = null); + + /// + /// Retries the last failed task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to false) + /// ApiResponse of Object(void) + ApiResponse RetryWithHttpInfo(string workflowId, bool? resumeSubworkflowTasks = null); + /// + /// Search for workflows based on payload and other parameters + /// + /// + /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional, default to 0) + /// (optional, default to 100) + /// (optional) + /// (optional, default to *) + /// (optional) + /// (optional, default to false) + /// ScrollableSearchResultWorkflowSummary + ScrollableSearchResultWorkflowSummary Search(string queryId = null, int? start = null, int? size = null, string sort = null, string freeText = null, string query = null, bool? skipCache = null); + + /// + /// Search for workflows based on payload and other parameters + /// + /// + /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional, default to 0) + /// (optional, default to 100) + /// (optional) + /// (optional, default to *) + /// (optional) + /// (optional, default to false) + /// ApiResponse of ScrollableSearchResultWorkflowSummary + ApiResponse SearchWithHttpInfo(string queryId = null, int? start = null, int? size = null, string sort = null, string freeText = null, string query = null, bool? skipCache = null); + /// + /// Search for workflows based on payload and other parameters + /// + /// + /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. + /// + /// Thrown when fails to make API call + /// (optional, default to 0) + /// (optional, default to 100) + /// (optional) + /// (optional, default to *) + /// (optional) + /// SearchResultWorkflow + SearchResultWorkflow SearchV2(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); + + /// + /// Search for workflows based on payload and other parameters + /// + /// + /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. + /// + /// Thrown when fails to make API call + /// (optional, default to 0) + /// (optional, default to 100) + /// (optional) + /// (optional, default to *) + /// (optional) + /// ApiResponse of SearchResultWorkflow + ApiResponse SearchV2WithHttpInfo(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); + /// + /// Search for workflows based on task parameters + /// + /// + /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC + /// + /// Thrown when fails to make API call + /// (optional, default to 0) + /// (optional, default to 100) + /// (optional) + /// (optional, default to *) + /// (optional) + /// SearchResultWorkflowSummary + SearchResultWorkflowSummary SearchWorkflowsByTasks(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); + + /// + /// Search for workflows based on task parameters + /// + /// + /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC + /// + /// Thrown when fails to make API call + /// (optional, default to 0) + /// (optional, default to 100) + /// (optional) + /// (optional, default to *) + /// (optional) + /// ApiResponse of SearchResultWorkflowSummary + ApiResponse SearchWorkflowsByTasksWithHttpInfo(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); + /// + /// Search for workflows based on task parameters + /// + /// + /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC + /// + /// Thrown when fails to make API call + /// (optional, default to 0) + /// (optional, default to 100) + /// (optional) + /// (optional, default to *) + /// (optional) + /// SearchResultWorkflow + SearchResultWorkflow SearchWorkflowsByTasksV2(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); + + /// + /// Search for workflows based on task parameters + /// + /// + /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC + /// + /// Thrown when fails to make API call + /// (optional, default to 0) + /// (optional, default to 100) + /// (optional) + /// (optional, default to *) + /// (optional) + /// ApiResponse of SearchResultWorkflow + ApiResponse SearchWorkflowsByTasksV2WithHttpInfo(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); + /// + /// Skips a given task from a current running workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + void SkipTaskFromWorkflow(string workflowId, string taskReferenceName, SkipTaskRequest skipTaskRequest); + + /// + /// Skips a given task from a current running workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// ApiResponse of Object(void) + ApiResponse SkipTaskFromWorkflowWithHttpInfo(string workflowId, string taskReferenceName, SkipTaskRequest skipTaskRequest); + /// + /// Start a new workflow with StartWorkflowRequest, which allows task to be executed in a domain + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// string + string StartWorkflow(StartWorkflowRequest request); + + /// + /// Start a new workflow with StartWorkflowRequest, which allows task to be executed in a domain + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of string + ApiResponse StartWorkflowWithHttpInfo(StartWorkflowRequest request); + /// + /// Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// (optional) + /// (optional, default to 0) + /// string + string StartWorkflow(string name, Dictionary input, int? version = null, string correlationId = null, int? priority = null); + + /// + /// Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// (optional) + /// (optional, default to 0) + /// ApiResponse of string + ApiResponse StartWorkflowWithHttpInfo(string name, Dictionary input, int? version = null, string correlationId = null, int? priority = null); + /// + /// Terminate workflow execution + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional, default to false) + /// + void Terminate(string workflowId, string reason = null, bool? triggerFailureWorkflow = null); + + /// + /// Terminate workflow execution + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional, default to false) + /// ApiResponse of Object(void) + ApiResponse TerminateWithHttpInfo(string workflowId, string reason = null, bool? triggerFailureWorkflow = null); + /// + /// Test workflow execution using mock data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Workflow + Workflow TestWorkflow(WorkflowTestRequest request); + + /// + /// Test workflow execution using mock data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Workflow + ApiResponse TestWorkflowWithHttpInfo(WorkflowTestRequest request); + #endregion Synchronous Operations + } +} \ No newline at end of file diff --git a/Conductor/Api/WorkflowResourceApi.cs b/Conductor/Api/WorkflowResourceApi.cs index 409632af..2cc166d9 100644 --- a/Conductor/Api/WorkflowResourceApi.cs +++ b/Conductor/Api/WorkflowResourceApi.cs @@ -7,720 +7,6 @@ namespace Conductor.Api { - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IWorkflowResourceApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Starts the decision task for a workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - void Decide(string workflowId); - - /// - /// Starts the decision task for a workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - ApiResponse DecideWithHttpInfo(string workflowId); - /// - /// Removes the workflow from the system - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to true) - /// - void Delete(string workflowId, bool? archiveWorkflow = null); - - /// - /// Removes the workflow from the system - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to true) - /// ApiResponse of Object(void) - ApiResponse DeleteWithHttpInfo(string workflowId, bool? archiveWorkflow = null); - /// - /// Execute a workflow synchronously - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - /// - /// (optional) - /// WorkflowRun - WorkflowRun ExecuteWorkflow(StartWorkflowRequest body, string requestId, string name, int? version, string waitUntilTaskRef = null); - - /// - /// Update the value of the workflow variables for the given workflow id - /// - /// - /// ApiResponse of Object(void) - Object UpdateWorkflowVariables(Workflow workflow); - /// - /// Execute a workflow synchronously - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - /// - /// (optional) - /// ApiResponse of WorkflowRun - ApiResponse ExecuteWorkflowWithHttpInfo(StartWorkflowRequest body, string requestId, string name, int? version, string waitUntilTaskRef = null); - /// - /// Gets the workflow by workflow id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to true) - /// (optional, default to false) - /// Workflow - Workflow GetExecutionStatus(string workflowId, bool? includeTasks = null, bool? summarize = null); - - /// - /// Gets the workflow by workflow id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to true) - /// (optional, default to false) - /// ApiResponse of Workflow - ApiResponse GetExecutionStatusWithHttpInfo(string workflowId, bool? includeTasks = null, bool? summarize = null); - /// - /// Gets the workflow tasks by workflow id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to 0) - /// (optional, default to 15) - /// (optional) - /// TaskListSearchResultSummary - TaskListSearchResultSummary GetExecutionStatusTaskList(string workflowId, int? start = null, int? count = null, string status = null); - - /// - /// Gets the workflow tasks by workflow id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to 0) - /// (optional, default to 15) - /// (optional) - /// ApiResponse of TaskListSearchResultSummary - ApiResponse GetExecutionStatusTaskListWithHttpInfo(string workflowId, int? start = null, int? count = null, string status = null); - /// - /// Get the uri and path of the external storage where the workflow payload is to be stored - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - /// ExternalStorageLocation - ExternalStorageLocation GetExternalStorageLocation(string path, string operation, string payloadType); - - /// - /// Get the uri and path of the external storage where the workflow payload is to be stored - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - /// ApiResponse of ExternalStorageLocation - ApiResponse GetExternalStorageLocationWithHttpInfo(string path, string operation, string payloadType); - /// - /// Retrieve all the running workflows - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to 1) - /// (optional) - /// (optional) - /// List<string> - List GetRunningWorkflow(string name, int? version = null, long? startTime = null, long? endTime = null); - - /// - /// Retrieve all the running workflows - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to 1) - /// (optional) - /// (optional) - /// ApiResponse of List<string> - ApiResponse> GetRunningWorkflowWithHttpInfo(string name, int? version = null, long? startTime = null, long? endTime = null); - /// - /// Gets the workflow by workflow id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to false) - /// (optional, default to false) - /// WorkflowStatus - WorkflowStatus GetWorkflowStatusSummary(string workflowId, bool? includeOutput = null, bool? includeVariables = null); - - /// - /// Gets the workflow by workflow id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to false) - /// (optional, default to false) - /// ApiResponse of WorkflowStatus - ApiResponse GetWorkflowStatusSummaryWithHttpInfo(string workflowId, bool? includeOutput = null, bool? includeVariables = null); - /// - /// Lists workflows for the given correlation id list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// (optional, default to false) - /// (optional, default to false) - /// Dictionary<string, List<Workflow>> - Dictionary> GetWorkflows(List body, string name, bool? includeClosed = null, bool? includeTasks = null); - - /// - /// Lists workflows for the given correlation id list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// (optional, default to false) - /// (optional, default to false) - /// ApiResponse of Dictionary<string, List<Workflow>> - ApiResponse>> GetWorkflowsWithHttpInfo(List body, string name, bool? includeClosed = null, bool? includeTasks = null); - /// - /// Lists workflows for the given correlation id list and workflow name list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to false) - /// (optional, default to false) - /// Dictionary<string, List<Workflow>> - Dictionary> GetWorkflows(CorrelationIdsSearchRequest body, bool? includeClosed = null, bool? includeTasks = null); - - /// - /// Lists workflows for the given correlation id list and workflow name list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to false) - /// (optional, default to false) - /// ApiResponse of Dictionary<string, List<Workflow>> - ApiResponse>> GetWorkflowsWithHttpInfo(CorrelationIdsSearchRequest body, bool? includeClosed = null, bool? includeTasks = null); - /// - /// Lists workflows for the given correlation id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// (optional, default to false) - /// (optional, default to false) - /// List<Workflow> - List GetWorkflows(string name, string correlationId, bool? includeClosed = null, bool? includeTasks = null); - - /// - /// Lists workflows for the given correlation id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// (optional, default to false) - /// (optional, default to false) - /// ApiResponse of List<Workflow> - ApiResponse> GetWorkflowsWithHttpInfo(string name, string correlationId, bool? includeClosed = null, bool? includeTasks = null); - /// - /// Pauses the workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - void PauseWorkflow(string workflowId); - - /// - /// Pauses the workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - ApiResponse PauseWorkflowWithHttpInfo(string workflowId); - /// - /// Jump workflow execution to given task - /// - /// - /// Jump workflow execution to given task. - /// - /// Thrown when fails to make API call - /// - /// - /// (optional) - /// - void JumpToTask(string workflowId, Dictionary input, string taskReferenceName = null); - - /// - /// Jump workflow execution to given task - /// - /// - /// Jump workflow execution to given task. - /// - /// Thrown when fails to make API call - /// - /// - /// (optional) - /// ApiResponse of Object(void) - ApiResponse JumpToTaskWithHttpInfo(Dictionary body, string workflowId, string taskReferenceName = null); - - /// - /// Reruns the workflow from a specific task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// string - string Rerun(RerunWorkflowRequest body, string workflowId); - - /// - /// Reruns the workflow from a specific task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of string - ApiResponse RerunWithHttpInfo(RerunWorkflowRequest body, string workflowId); - /// - /// Resets callback times of all non-terminal SIMPLE tasks to 0 - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - void ResetWorkflow(string workflowId); - - /// - /// Resets callback times of all non-terminal SIMPLE tasks to 0 - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - ApiResponse ResetWorkflowWithHttpInfo(string workflowId); - /// - /// Restarts a completed workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to false) - /// - void Restart(string workflowId, bool? useLatestDefinitions = null); - - /// - /// Restarts a completed workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to false) - /// ApiResponse of Object(void) - ApiResponse RestartWithHttpInfo(string workflowId, bool? useLatestDefinitions = null); - /// - /// Resumes the workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - void ResumeWorkflow(string workflowId); - - /// - /// Resumes the workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - ApiResponse ResumeWorkflowWithHttpInfo(string workflowId); - /// - /// Retries the last failed task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to false) - /// - void Retry(string workflowId, bool? resumeSubworkflowTasks = null); - - /// - /// Retries the last failed task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to false) - /// ApiResponse of Object(void) - ApiResponse RetryWithHttpInfo(string workflowId, bool? resumeSubworkflowTasks = null); - /// - /// Search for workflows based on payload and other parameters - /// - /// - /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. - /// - /// Thrown when fails to make API call - /// (optional) - /// (optional, default to 0) - /// (optional, default to 100) - /// (optional) - /// (optional, default to *) - /// (optional) - /// (optional, default to false) - /// ScrollableSearchResultWorkflowSummary - ScrollableSearchResultWorkflowSummary Search(string queryId = null, int? start = null, int? size = null, string sort = null, string freeText = null, string query = null, bool? skipCache = null); - - /// - /// Search for workflows based on payload and other parameters - /// - /// - /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. - /// - /// Thrown when fails to make API call - /// (optional) - /// (optional, default to 0) - /// (optional, default to 100) - /// (optional) - /// (optional, default to *) - /// (optional) - /// (optional, default to false) - /// ApiResponse of ScrollableSearchResultWorkflowSummary - ApiResponse SearchWithHttpInfo(string queryId = null, int? start = null, int? size = null, string sort = null, string freeText = null, string query = null, bool? skipCache = null); - /// - /// Search for workflows based on payload and other parameters - /// - /// - /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. - /// - /// Thrown when fails to make API call - /// (optional, default to 0) - /// (optional, default to 100) - /// (optional) - /// (optional, default to *) - /// (optional) - /// SearchResultWorkflow - SearchResultWorkflow SearchV2(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); - - /// - /// Search for workflows based on payload and other parameters - /// - /// - /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. - /// - /// Thrown when fails to make API call - /// (optional, default to 0) - /// (optional, default to 100) - /// (optional) - /// (optional, default to *) - /// (optional) - /// ApiResponse of SearchResultWorkflow - ApiResponse SearchV2WithHttpInfo(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); - /// - /// Search for workflows based on task parameters - /// - /// - /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC - /// - /// Thrown when fails to make API call - /// (optional, default to 0) - /// (optional, default to 100) - /// (optional) - /// (optional, default to *) - /// (optional) - /// SearchResultWorkflowSummary - SearchResultWorkflowSummary SearchWorkflowsByTasks(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); - - /// - /// Search for workflows based on task parameters - /// - /// - /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC - /// - /// Thrown when fails to make API call - /// (optional, default to 0) - /// (optional, default to 100) - /// (optional) - /// (optional, default to *) - /// (optional) - /// ApiResponse of SearchResultWorkflowSummary - ApiResponse SearchWorkflowsByTasksWithHttpInfo(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); - /// - /// Search for workflows based on task parameters - /// - /// - /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC - /// - /// Thrown when fails to make API call - /// (optional, default to 0) - /// (optional, default to 100) - /// (optional) - /// (optional, default to *) - /// (optional) - /// SearchResultWorkflow - SearchResultWorkflow SearchWorkflowsByTasksV2(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); - - /// - /// Search for workflows based on task parameters - /// - /// - /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC - /// - /// Thrown when fails to make API call - /// (optional, default to 0) - /// (optional, default to 100) - /// (optional) - /// (optional, default to *) - /// (optional) - /// ApiResponse of SearchResultWorkflow - ApiResponse SearchWorkflowsByTasksV2WithHttpInfo(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); - /// - /// Skips a given task from a current running workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - /// - void SkipTaskFromWorkflow(string workflowId, string taskReferenceName, SkipTaskRequest skipTaskRequest); - - /// - /// Skips a given task from a current running workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - /// ApiResponse of Object(void) - ApiResponse SkipTaskFromWorkflowWithHttpInfo(string workflowId, string taskReferenceName, SkipTaskRequest skipTaskRequest); - /// - /// Start a new workflow with StartWorkflowRequest, which allows task to be executed in a domain - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// string - string StartWorkflow(StartWorkflowRequest body); - - /// - /// Start a new workflow with StartWorkflowRequest, which allows task to be executed in a domain - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of string - ApiResponse StartWorkflowWithHttpInfo(StartWorkflowRequest body); - /// - /// Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// (optional) - /// (optional) - /// (optional, default to 0) - /// string - string StartWorkflow(string name, Dictionary body, int? version = null, string correlationId = null, int? priority = null); - - /// - /// Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// (optional) - /// (optional) - /// (optional, default to 0) - /// ApiResponse of string - ApiResponse StartWorkflowWithHttpInfo(string name, Dictionary body, int? version = null, string correlationId = null, int? priority = null); - /// - /// Terminate workflow execution - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional) - /// (optional, default to false) - /// - void Terminate(string workflowId, string reason = null, bool? triggerFailureWorkflow = null); - - /// - /// Terminate workflow execution - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional) - /// (optional, default to false) - /// ApiResponse of Object(void) - ApiResponse TerminateWithHttpInfo(string workflowId, string reason = null, bool? triggerFailureWorkflow = null); - /// - /// Test workflow execution using mock data - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Workflow - Workflow TestWorkflow(WorkflowTestRequest body); - - /// - /// Test workflow execution using mock data - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Workflow - ApiResponse TestWorkflowWithHttpInfo(WorkflowTestRequest body); - /// - /// Force upload all completed workflows to document store - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Object - Object UploadCompletedWorkflows(); - - /// - /// Force upload all completed workflows to document store - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of Object - ApiResponse UploadCompletedWorkflowsWithHttpInfo(); - #endregion Synchronous Operations - } - /// /// Represents a collection of functions to interact with the API endpoints /// @@ -1498,14 +784,14 @@ public ApiResponse GetWorkflowStatusSummaryWithHttpInfo(string w /// Lists workflows for the given correlation id list /// /// Thrown when fails to make API call - /// + /// /// /// (optional, default to false) /// (optional, default to false) /// Dictionary<string, List<Workflow>> - public Dictionary> GetWorkflows(List body, string name, bool? includeClosed = null, bool? includeTasks = null) + public Dictionary> GetWorkflows(List correlationIds, string name, bool? includeClosed = null, bool? includeTasks = null) { - ApiResponse>> localVarResponse = GetWorkflowsWithHttpInfo(body, name, includeClosed, includeTasks); + ApiResponse>> localVarResponse = GetWorkflowsWithHttpInfo(correlationIds, name, includeClosed, includeTasks); return localVarResponse.Data; } @@ -1513,15 +799,15 @@ public Dictionary> GetWorkflows(List body, string /// Lists workflows for the given correlation id list /// /// Thrown when fails to make API call - /// + /// /// /// (optional, default to false) /// (optional, default to false) /// ApiResponse of Dictionary<string, List<Workflow>> - public ApiResponse>> GetWorkflowsWithHttpInfo(List body, string name, bool? includeClosed = null, bool? includeTasks = null) + public ApiResponse>> GetWorkflowsWithHttpInfo(List correlationIds, string name, bool? includeClosed = null, bool? includeTasks = null) { // verify the required parameter 'body' is set - if (body == null) + if (correlationIds == null) throw new ApiException(400, "Missing required parameter 'body' when calling WorkflowResourceApi->GetWorkflows"); // verify the required parameter 'name' is set if (name == null) @@ -1552,13 +838,13 @@ public ApiResponse>> GetWorkflowsWithHttpInfo( if (name != null) localVarPathParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // path parameter if (includeClosed != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "includeClosed", includeClosed)); // query parameter if (includeTasks != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "includeTasks", includeTasks)); // query parameter - if (body != null && body.GetType() != typeof(byte[])) + if (correlationIds != null && correlationIds.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(correlationIds); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = correlationIds; // byte array } // authentication (api_key) required if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) @@ -1588,13 +874,13 @@ public ApiResponse>> GetWorkflowsWithHttpInfo( /// Lists workflows for the given correlation id list and workflow name list /// /// Thrown when fails to make API call - /// + /// /// (optional, default to false) /// (optional, default to false) /// Dictionary<string, List<Workflow>> - public Dictionary> GetWorkflows(CorrelationIdsSearchRequest body, bool? includeClosed = null, bool? includeTasks = null) + public Dictionary> GetWorkflows(CorrelationIdsSearchRequest request, bool? includeClosed = null, bool? includeTasks = null) { - ApiResponse>> localVarResponse = GetWorkflowsWithHttpInfo(body, includeClosed, includeTasks); + ApiResponse>> localVarResponse = GetWorkflowsWithHttpInfo(request, includeClosed, includeTasks); return localVarResponse.Data; } @@ -1602,14 +888,14 @@ public Dictionary> GetWorkflows(CorrelationIdsSearchReque /// Lists workflows for the given correlation id list and workflow name list /// /// Thrown when fails to make API call - /// + /// /// (optional, default to false) /// (optional, default to false) /// ApiResponse of Dictionary<string, List<Workflow>> - public ApiResponse>> GetWorkflowsWithHttpInfo(CorrelationIdsSearchRequest body, bool? includeClosed = null, bool? includeTasks = null) + public ApiResponse>> GetWorkflowsWithHttpInfo(CorrelationIdsSearchRequest request, bool? includeClosed = null, bool? includeTasks = null) { // verify the required parameter 'body' is set - if (body == null) + if (request == null) throw new ApiException(400, "Missing required parameter 'body' when calling WorkflowResourceApi->GetWorkflows"); var localVarPath = "/workflow/correlated/batch"; @@ -1636,13 +922,13 @@ public ApiResponse>> GetWorkflowsWithHttpInfo( if (includeClosed != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "includeClosed", includeClosed)); // query parameter if (includeTasks != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "includeTasks", includeTasks)); // query parameter - if (body != null && body.GetType() != typeof(byte[])) + if (request != null && request.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(request); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = request; // byte array } // authentication (api_key) required if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) @@ -1819,103 +1105,19 @@ public ApiResponse PauseWorkflowWithHttpInfo(string workflowId) } - /// - /// Jump workflow execution to given task Jump workflow execution to given task. - /// - /// Thrown when fails to make API call - /// - /// - /// (optional) - /// - public void JumpToTask(string workflowId, Dictionary input, string taskReferenceName = null) - { - JumpToTaskWithHttpInfo(input, workflowId, taskReferenceName); - } - - - /// - /// Jump workflow execution to given task Jump workflow execution to given task. - /// - /// Thrown when fails to make API call - /// - /// - /// (optional) - /// ApiResponse of Object(void) - public ApiResponse JumpToTaskWithHttpInfo(Dictionary body, string workflowId, string taskReferenceName = null) - { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'input' when calling WorkflowResourceApi->JumpToTask"); - // verify the required parameter 'workflowId' is set - if (workflowId == null) - throw new ApiException(400, "Missing required parameter 'workflowId' when calling WorkflowResourceApi->JumpToTask"); - - var localVarPath = "/workflow/{workflowId}/jump/{taskReferenceName}"; - 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 (workflowId != null) localVarPathParams.Add("workflowId", this.Configuration.ApiClient.ParameterToString(workflowId)); // path parameter - if (taskReferenceName != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "taskReferenceName", taskReferenceName)); // 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 - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int)localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("JumpToTask", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - null); - } + /// /// Reruns the workflow from a specific task /// /// Thrown when fails to make API call - /// + /// /// /// string - public string Rerun(RerunWorkflowRequest body, string workflowId) + public string Rerun(RerunWorkflowRequest request, string workflowId) { - ApiResponse localVarResponse = RerunWithHttpInfo(body, workflowId); + ApiResponse localVarResponse = RerunWithHttpInfo(request, workflowId); return localVarResponse.Data; } @@ -1923,13 +1125,13 @@ public string Rerun(RerunWorkflowRequest body, string workflowId) /// Reruns the workflow from a specific task /// /// Thrown when fails to make API call - /// + /// /// /// ApiResponse of string - public ApiResponse RerunWithHttpInfo(RerunWorkflowRequest body, string workflowId) + public ApiResponse RerunWithHttpInfo(RerunWorkflowRequest request, string workflowId) { // verify the required parameter 'body' is set - if (body == null) + if (request == null) throw new ApiException(400, "Missing required parameter 'body' when calling WorkflowResourceApi->Rerun"); // verify the required parameter 'workflowId' is set if (workflowId == null) @@ -1958,13 +1160,13 @@ public ApiResponse RerunWithHttpInfo(RerunWorkflowRequest body, string w localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (workflowId != null) localVarPathParams.Add("workflowId", this.Configuration.ApiClient.ParameterToString(workflowId)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) + if (request != null && request.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(request); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = request; // byte array } // authentication (api_key) required if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) @@ -2674,11 +1876,11 @@ public ApiResponse SkipTaskFromWorkflowWithHttpInfo(string workflowId, s /// Start a new workflow with StartWorkflowRequest, which allows task to be executed in a domain /// /// Thrown when fails to make API call - /// + /// /// string - public string StartWorkflow(StartWorkflowRequest body) + public string StartWorkflow(StartWorkflowRequest request) { - ApiResponse localVarResponse = StartWorkflowWithHttpInfo(body); + ApiResponse localVarResponse = StartWorkflowWithHttpInfo(request); return localVarResponse.Data; } @@ -2686,12 +1888,12 @@ public string StartWorkflow(StartWorkflowRequest body) /// Start a new workflow with StartWorkflowRequest, which allows task to be executed in a domain /// /// Thrown when fails to make API call - /// + /// /// ApiResponse of string - public ApiResponse StartWorkflowWithHttpInfo(StartWorkflowRequest body) + public ApiResponse StartWorkflowWithHttpInfo(StartWorkflowRequest request) { // verify the required parameter 'body' is set - if (body == null) + if (request == null) throw new ApiException(400, "Missing required parameter 'body' when calling WorkflowResourceApi->StartWorkflow"); var localVarPath = "/workflow"; @@ -2716,13 +1918,13 @@ public ApiResponse StartWorkflowWithHttpInfo(StartWorkflowRequest body) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (request != null && request.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(request); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = request; // byte array } // authentication (api_key) required if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) @@ -2752,15 +1954,15 @@ public ApiResponse StartWorkflowWithHttpInfo(StartWorkflowRequest body) /// Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking /// /// Thrown when fails to make API call - /// + /// /// /// (optional) /// (optional) /// (optional, default to 0) /// string - public string StartWorkflow(string name, Dictionary body, int? version = null, string correlationId = null, int? priority = null) + public string StartWorkflow(string name, Dictionary input, int? version = null, string correlationId = null, int? priority = null) { - ApiResponse localVarResponse = StartWorkflowWithHttpInfo(name, body, version, correlationId, priority); + ApiResponse localVarResponse = StartWorkflowWithHttpInfo(name, input, version, correlationId, priority); return localVarResponse.Data; } @@ -2768,16 +1970,16 @@ public string StartWorkflow(string name, Dictionary body, int? v /// Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking /// /// Thrown when fails to make API call - /// + /// /// /// (optional) /// (optional) /// (optional, default to 0) /// ApiResponse of string - public ApiResponse StartWorkflowWithHttpInfo(string name, Dictionary body, int? version = null, string correlationId = null, int? priority = null) + public ApiResponse StartWorkflowWithHttpInfo(string name, Dictionary input, int? version = null, string correlationId = null, int? priority = null) { // verify the required parameter 'body' is set - if (body == null) + if (input == null) throw new ApiException(400, "Missing required parameter 'body' when calling WorkflowResourceApi->StartWorkflow"); // verify the required parameter 'name' is set if (name == null) @@ -2809,13 +2011,13 @@ public ApiResponse StartWorkflowWithHttpInfo(string name, Dictionary TerminateWithHttpInfo(string workflowId, string reaso /// Test workflow execution using mock data /// /// Thrown when fails to make API call - /// + /// /// Workflow - public Workflow TestWorkflow(WorkflowTestRequest body) + public Workflow TestWorkflow(WorkflowTestRequest request) { - ApiResponse localVarResponse = TestWorkflowWithHttpInfo(body); + ApiResponse localVarResponse = TestWorkflowWithHttpInfo(request); return localVarResponse.Data; } @@ -2931,13 +2133,13 @@ public Workflow TestWorkflow(WorkflowTestRequest body) /// Test workflow execution using mock data /// /// Thrown when fails to make API call - /// + /// /// ApiResponse of Workflow - public ApiResponse TestWorkflowWithHttpInfo(WorkflowTestRequest body) + public ApiResponse TestWorkflowWithHttpInfo(WorkflowTestRequest request) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling WorkflowResourceApi->TestWorkflow"); + // verify the required parameter 'request' is set + if (request == null) + throw new ApiException(400, "Missing required parameter 'request' when calling WorkflowResourceApi->TestWorkflow"); var localVarPath = "/workflow/test"; var localVarPathParams = new Dictionary(); @@ -2961,13 +2163,13 @@ public ApiResponse TestWorkflowWithHttpInfo(WorkflowTestRequest body) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (request != null && request.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(request); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = request; // byte array } // authentication (api_key) required if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) diff --git a/Conductor/Client/Models/IdempotencyStrategy.cs b/Conductor/Client/Models/IdempotencyStrategy.cs new file mode 100644 index 00000000..7d44f46d --- /dev/null +++ b/Conductor/Client/Models/IdempotencyStrategy.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Conductor.Client.Models +{ + [JsonConverter(typeof(StringEnumConverter))] + public enum IdempotencyStrategy + { + [EnumMember(Value = "FAIL")] + FAIL = 0, + [EnumMember(Value = "RETURN_EXISTING")] + RETURN_EXISTING = 1 + } +} \ No newline at end of file diff --git a/Conductor/Client/Models/StartWorkflowRequest.cs b/Conductor/Client/Models/StartWorkflowRequest.cs index 013751e3..e83bb2de 100644 --- a/Conductor/Client/Models/StartWorkflowRequest.cs +++ b/Conductor/Client/Models/StartWorkflowRequest.cs @@ -27,17 +27,17 @@ public partial class StartWorkflowRequest : IEquatable, IV /// taskToDomain. /// version. /// workflowDef. - public StartWorkflowRequest(string correlationId = default(string), string createdBy = default(string), string externalInputPayloadStoragePath = default(string), Dictionary input = default(Dictionary), string name = default(string), int? priority = default(int?), Dictionary taskToDomain = default(Dictionary), int? version = default(int?), WorkflowDef workflowDef = default(WorkflowDef)) + public StartWorkflowRequest(string correlationId = default(string), string createdBy = default(string), + string externalInputPayloadStoragePath = default(string), + Dictionary input = default(Dictionary), + string name = default(string), + int? priority = default(int?), + Dictionary taskToDomain = default(Dictionary), + int? version = default(int?), + WorkflowDef workflowDef = default(WorkflowDef) + ) { - // to ensure "name" is required (not null) - if (name == null) - { - throw new InvalidDataException("name is a required property for StartWorkflowRequest and cannot be null"); - } - else - { - this.Name = name; - } + this.Name = name; this.CorrelationId = correlationId; this.CreatedBy = createdBy; this.ExternalInputPayloadStoragePath = externalInputPayloadStoragePath; @@ -46,8 +46,14 @@ public partial class StartWorkflowRequest : IEquatable, IV this.TaskToDomain = taskToDomain; this.Version = version; this.WorkflowDef = workflowDef; + // this.IdempotencyKey = idempotencyKey; + // this.IdempotencyStrategy = idempotencyStrategy; } + public IdempotencyStrategy IdempotencyStrategy { get; set; } + + public string IdempotencyKey { get; set; } + /// /// Gets or Sets CorrelationId /// From 135476888a5c07404ceae90d1e3f194bd4938c2e Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Wed, 31 Jan 2024 13:37:32 -0800 Subject: [PATCH 2/4] add support for new apis --- Conductor/Api/IWorkflowResourceApi.cs | 67 ++++- Conductor/Api/TaskResourceApi.cs | 141 ++++++++- Conductor/Api/WorkflowResourceApi.cs | 142 +++++++-- .../Client/Models/StartWorkflowRequest.cs | 12 +- Conductor/Client/Models/TaskDef.cs | 20 +- Conductor/Client/Models/TaskResult.cs | 20 +- .../Client/Models/WorkflowStateUpdate.cs | 140 +++++++++ Tests/Api/WorkflowResourceApiTest.cs | 270 +++++++++++++++++- Tests/Worker/Workers.cs | 96 +++---- Tests/conductor-csharp.test.csproj | 4 +- 10 files changed, 785 insertions(+), 127 deletions(-) create mode 100644 Conductor/Client/Models/WorkflowStateUpdate.cs diff --git a/Conductor/Api/IWorkflowResourceApi.cs b/Conductor/Api/IWorkflowResourceApi.cs index 9fb1468e..48b9282f 100644 --- a/Conductor/Api/IWorkflowResourceApi.cs +++ b/Conductor/Api/IWorkflowResourceApi.cs @@ -73,9 +73,19 @@ public interface IWorkflowResourceApi : IApiAccessor /// /// Update the value of the workflow variables for the given workflow id /// - /// - /// ApiResponse of Object(void) - Object UpdateWorkflowVariables(Workflow workflow); + /// + /// /// + /// Workflow + Workflow UpdateWorkflowVariables(string workflowId, Dictionary variables); + + /// + /// Update the value of the workflow variables for the given workflow id and return api response + /// + /// + /// /// + /// Workflow + ApiResponse UpdateWorkflowVariablesWithHttpInfo(string workflowId, Dictionary variables); + /// /// Execute a workflow synchronously /// @@ -672,6 +682,57 @@ public interface IWorkflowResourceApi : IApiAccessor /// /// ApiResponse of Workflow ApiResponse TestWorkflowWithHttpInfo(WorkflowTestRequest request); + + /// + /// Update a workflow state by updating variables or in progress task Updates the workflow variables, tasks and triggers evaluation. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// (optional, default to 10) + /// WorkflowRun + WorkflowRun UpdateWorkflow(string workflowId, WorkflowStateUpdate request, + List waitUntilTaskRefs = null, int? waitForSeconds = null); + + + /// + /// Update a workflow state by updating variables or in progress task Updates the workflow variables, tasks and triggers evaluation. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// (optional, default to 10) + /// WorkflowRun + ApiResponse UpdateWorkflowWithHttpInfo(string workflowId, WorkflowStateUpdate request, + List waitUntilTaskRefs = null, int? waitForSeconds = null); + + /// + /// Gets the workflow by workflow id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// Workflow + Workflow GetWorkflow(string workflowId, bool includeTasks); + + + /// + /// Gets the workflow by workflow id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// Workflow + ApiResponse GetWorkflowWithHttpInfo(string workflowId, bool includeTasks); + #endregion Synchronous Operations } } \ No newline at end of file diff --git a/Conductor/Api/TaskResourceApi.cs b/Conductor/Api/TaskResourceApi.cs index f25b67e3..9c801518 100644 --- a/Conductor/Api/TaskResourceApi.cs +++ b/Conductor/Api/TaskResourceApi.cs @@ -396,6 +396,38 @@ public interface ITaskResourceApi : IApiAccessor /// /// ApiResponse of string ApiResponse UpdateTaskWithHttpInfo(Dictionary body, string workflowId, string taskRefName, string status, string workerid = null); + + + //aa + /// + /// Update a task By Ref Name, evaluates the workflow and returns the updated workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// (optional) + /// Workflow + Workflow UpdateTaskSync(Dictionary output, string workflowId, string taskRefName, TaskResult.StatusEnum status, string workerid = null); + + /// + /// Update a task By Ref Name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// ApiResponse of Workflow + ApiResponse UpdateTaskSyncWithHttpInfo(Dictionary output, string workflowId, string taskRefName, TaskResult.StatusEnum status, string workerid = null); + //aaa #endregion Synchronous Operations } @@ -1704,14 +1736,107 @@ public ApiResponse UpdateTaskWithHttpInfo(Dictionary bod (string)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } - // public ExternalStorageLocation GetExternalStorageLocation(string path, string operation, string payloadType) - // { - // throw new NotImplementedException(); - // } + /// + /// Update a task By Ref Name + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// (optional) + /// string + public Workflow UpdateTaskSync(Dictionary output, string workflowId, string taskRefName, TaskResult.StatusEnum status, string workerid = null) + { + ApiResponse localVarResponse = UpdateTaskSyncWithHttpInfo(output, workflowId, taskRefName, status, workerid); + return localVarResponse.Data; + } + + /// + /// Update a task By Ref Name + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// ApiResponse of string + public ApiResponse UpdateTaskSyncWithHttpInfo(Dictionary output, string workflowId, string taskRefName, TaskResult.StatusEnum status, string workerid = null) + { + // verify the required parameter 'body' is set + if (output == null) + throw new ApiException(400, "Missing required parameter 'body' when calling TaskResourceApi->UpdateTask"); + // verify the required parameter 'workflowId' is set + if (workflowId == null) + throw new ApiException(400, "Missing required parameter 'workflowId' when calling TaskResourceApi->UpdateTask"); + // verify the required parameter 'taskRefName' is set + if (taskRefName == null) + throw new ApiException(400, "Missing required parameter 'taskRefName' when calling TaskResourceApi->UpdateTask"); + // verify the required parameter 'status' is set + if (status == null) + throw new ApiException(400, "Missing required parameter 'status' when calling TaskResourceApi->UpdateTask"); + + var localVarPath = "/tasks/{workflowId}/{taskRefName}/{status}/sync"; + 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[] { + "text/plain" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (workerid == null) + { + workerid = Environment.MachineName; + } - // public ApiResponse GetExternalStorageLocationWithHttpInfo(string path, string operation, string payloadType) - // { - // throw new NotImplementedException(); - // } + if (workflowId != null) localVarPathParams.Add("workflowId", this.Configuration.ApiClient.ParameterToString(workflowId)); // path parameter + if (taskRefName != null) localVarPathParams.Add("taskRefName", this.Configuration.ApiClient.ParameterToString(taskRefName)); // path parameter + if (status != null) localVarPathParams.Add("status", this.Configuration.ApiClient.ParameterToString(status)); // path parameter + if (workerid != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "workerid", workerid)); // query parameter + if (output != null && output.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(output); // http body (model) parameter + } + else + { + localVarPostBody = output; // byte array + } + // authentication (api_key) required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdateTask", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (Workflow)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Workflow))); + } } } diff --git a/Conductor/Api/WorkflowResourceApi.cs b/Conductor/Api/WorkflowResourceApi.cs index 2cc166d9..bf46ae56 100644 --- a/Conductor/Api/WorkflowResourceApi.cs +++ b/Conductor/Api/WorkflowResourceApi.cs @@ -321,25 +321,24 @@ public ApiResponse ExecuteWorkflowWithHttpInfo(StartWorkflowRequest (WorkflowRun)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(WorkflowRun))); } - public Object UpdateWorkflowVariables(Workflow workflow) + public Workflow UpdateWorkflowVariables(string workflowId, Dictionary variables) { - ApiResponse localVarResponse = UpdateWorkflowVariablesWithHttpInfo(workflow); + ApiResponse localVarResponse = UpdateWorkflowVariablesWithHttpInfo(workflowId, variables); return localVarResponse.Data; } - public ApiResponse UpdateWorkflowVariablesWithHttpInfo(Workflow workflow) + public ApiResponse UpdateWorkflowVariablesWithHttpInfo(string workflowId, Dictionary variables) { // verify the required parameter 'body' is set - if (workflow == null) - throw new ApiException(400, "Missing required parameter 'body' when calling WorkflowResourceApi->Update"); + if (workflowId == null) + throw new ApiException(400, "Missing required parameter 'workflowId' when calling WorkflowResourceApi->UpdateWorkflowVariables"); - if (string.IsNullOrEmpty(workflow.WorkflowId)) - throw new ApiException(400, "Missing required parameter 'WorkflowId' when calling WorkflowResourceApi->Update"); + - if (workflow.Variables == null) - throw new ApiException(400, "Missing required parameter 'Variables' when calling WorkflowResourceApi->Update"); + if (variables == null) + throw new ApiException(400, "Missing required parameter 'variables' when calling WorkflowResourceApi->UpdateWorkflowVariables"); - var localVarPath = $"/workflow/{workflow.WorkflowId}/variables"; + var localVarPath = $"/workflow/{workflowId}/variables"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); @@ -360,11 +359,8 @@ public ApiResponse UpdateWorkflowVariablesWithHttpInfo(Workflow workflow String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - if (workflow != null && workflow.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(workflow.Variables); - } + + localVarPostBody = this.Configuration.ApiClient.Serialize(variables); // authentication (api_key) required if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) @@ -383,9 +379,9 @@ public ApiResponse UpdateWorkflowVariablesWithHttpInfo(Workflow workflow if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + (Workflow)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Workflow))); } /// @@ -2258,5 +2254,117 @@ public ApiResponse UploadCompletedWorkflowsWithHttpInfo() localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); } + + /// + /// Update a workflow state by updating variables or in progress task Updates the workflow variables, tasks and triggers evaluation. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// (optional, default to 10) + /// WorkflowRun + public WorkflowRun UpdateWorkflow (string workflowId, WorkflowStateUpdate request, + List waitUntilTaskRefs = null, int? waitForSeconds = null) + { + ApiResponse localVarResponse = UpdateWorkflowWithHttpInfo(workflowId, request, waitUntilTaskRefs, waitForSeconds); + return localVarResponse.Data; + } + + + /// + /// Update a workflow state by updating variables or in progress task Updates the workflow variables, tasks and triggers evaluation. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// (optional, default to 10) + /// ApiResponse of WorkflowRun + public ApiResponse< WorkflowRun > UpdateWorkflowWithHttpInfo (string workflowId, WorkflowStateUpdate request, + List waitUntilTaskRefs = null, int? waitForSeconds = null) + { + string requestId = Guid.NewGuid().ToString(); + string waitUntilTaskRef = waitUntilTaskRefs != null && waitUntilTaskRefs.Count > 0 ? + waitUntilTaskRefs.Aggregate((a, b) => a + ", " + b) : null; + + // verify the required parameter 'request' is set + if (request == null) + throw new ApiException(400, "Missing required parameter 'request' when calling WorkflowResourceApi->UpdateWorkflowAndTaskState"); + // verify the required parameter 'requestId' is set + if (requestId == null) + throw new ApiException(400, "Missing required parameter 'requestId' when calling WorkflowResourceApi->UpdateWorkflowAndTaskState"); + // verify the required parameter 'workflowId' is set + if (workflowId == null) + throw new ApiException(400, "Missing required parameter 'workflowId' when calling WorkflowResourceApi->UpdateWorkflowAndTaskState"); + + var localVarPath = "/workflow/{workflowId}/state"; + 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 (workflowId != null) localVarPathParams.Add("workflowId", this.Configuration.ApiClient.ParameterToString(workflowId)); // path parameter + if (requestId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "requestId", requestId)); // query parameter + if (waitUntilTaskRef != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "waitUntilTaskRef", waitUntilTaskRef)); // query parameter + if (waitForSeconds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "waitForSeconds", waitForSeconds)); // query parameter + if (request != null && request.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(request); // http body (model) parameter + } + else + { + localVarPostBody = request; // byte array + } + + // authentication (api_key) required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdateWorkflowAndTaskState", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (WorkflowRun) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(WorkflowRun))); + } + + public Workflow GetWorkflow(string workflowId, bool includeTasks) + { + return GetExecutionStatus(workflowId, includeTasks); + } + + public ApiResponse GetWorkflowWithHttpInfo(string workflowId, bool includeTasks) + { + return GetExecutionStatusWithHttpInfo(workflowId, includeTasks); + } } } diff --git a/Conductor/Client/Models/StartWorkflowRequest.cs b/Conductor/Client/Models/StartWorkflowRequest.cs index e83bb2de..0d67d0c4 100644 --- a/Conductor/Client/Models/StartWorkflowRequest.cs +++ b/Conductor/Client/Models/StartWorkflowRequest.cs @@ -27,6 +27,8 @@ public partial class StartWorkflowRequest : IEquatable, IV /// taskToDomain. /// version. /// workflowDef. + /// idempotencyKey. + /// idempotencyStrategy. public StartWorkflowRequest(string correlationId = default(string), string createdBy = default(string), string externalInputPayloadStoragePath = default(string), Dictionary input = default(Dictionary), @@ -34,7 +36,9 @@ public partial class StartWorkflowRequest : IEquatable, IV int? priority = default(int?), Dictionary taskToDomain = default(Dictionary), int? version = default(int?), - WorkflowDef workflowDef = default(WorkflowDef) + WorkflowDef workflowDef = default(WorkflowDef), + string idempotencyKey = default(string), + IdempotencyStrategy idempotencyStrategy = IdempotencyStrategy.FAIL ) { this.Name = name; @@ -46,12 +50,14 @@ public partial class StartWorkflowRequest : IEquatable, IV this.TaskToDomain = taskToDomain; this.Version = version; this.WorkflowDef = workflowDef; - // this.IdempotencyKey = idempotencyKey; - // this.IdempotencyStrategy = idempotencyStrategy; + this.IdempotencyKey = idempotencyKey; + this.IdempotencyStrategy = idempotencyStrategy; } + [DataMember(Name = "idempotencyStrategy", EmitDefaultValue = true)] public IdempotencyStrategy IdempotencyStrategy { get; set; } + [DataMember(Name = "idempotencyKey", EmitDefaultValue = false)] public string IdempotencyKey { get; set; } /// diff --git a/Conductor/Client/Models/TaskDef.cs b/Conductor/Client/Models/TaskDef.cs index 789c15ee..db48d7f2 100644 --- a/Conductor/Client/Models/TaskDef.cs +++ b/Conductor/Client/Models/TaskDef.cs @@ -99,24 +99,8 @@ public enum TimeoutPolicyEnum /// updatedBy. public TaskDef(int? backoffScaleFactor = default(int?), int? concurrentExecLimit = default(int?), long? createTime = default(long?), string createdBy = default(string), string description = default(string), string executionNameSpace = default(string), List inputKeys = default(List), Dictionary inputTemplate = default(Dictionary), string isolationGroupId = default(string), string name = default(string), List outputKeys = default(List), string ownerApp = default(string), string ownerEmail = default(string), int? pollTimeoutSeconds = default(int?), int? rateLimitFrequencyInSeconds = default(int?), int? rateLimitPerFrequency = default(int?), long? responseTimeoutSeconds = default(long?), int? retryCount = default(int?), int? retryDelaySeconds = default(int?), RetryLogicEnum? retryLogic = default(RetryLogicEnum?), TimeoutPolicyEnum? timeoutPolicy = default(TimeoutPolicyEnum?), long? timeoutSeconds = default(long?), long? updateTime = default(long?), string updatedBy = default(string)) { - // to ensure "name" is required (not null) - if (name == null) - { - throw new InvalidDataException("name is a required property for TaskDef and cannot be null"); - } - else - { - this.Name = name; - } - // to ensure "timeoutSeconds" is required (not null) - if (timeoutSeconds == null) - { - throw new InvalidDataException("timeoutSeconds is a required property for TaskDef and cannot be null"); - } - else - { - this.TimeoutSeconds = timeoutSeconds; - } + this.TimeoutSeconds = timeoutSeconds; + this.Name = name; this.BackoffScaleFactor = backoffScaleFactor; this.ConcurrentExecLimit = concurrentExecLimit; this.CreateTime = createTime; diff --git a/Conductor/Client/Models/TaskResult.cs b/Conductor/Client/Models/TaskResult.cs index 38acbcd9..84bc9f18 100644 --- a/Conductor/Client/Models/TaskResult.cs +++ b/Conductor/Client/Models/TaskResult.cs @@ -63,24 +63,8 @@ public enum StatusEnum /// workflowInstanceId (required). public TaskResult(long? callbackAfterSeconds = default(long?), string externalOutputPayloadStoragePath = default(string), List logs = default(List), Dictionary outputData = default(Dictionary), string reasonForIncompletion = default(string), StatusEnum? status = default(StatusEnum?), string subWorkflowId = default(string), string taskId = default(string), string workerId = default(string), string workflowInstanceId = default(string)) { - // to ensure "taskId" is required (not null) - if (taskId == null) - { - throw new InvalidDataException("taskId is a required property for TaskResult and cannot be null"); - } - else - { - this.TaskId = taskId; - } - // to ensure "workflowInstanceId" is required (not null) - if (workflowInstanceId == null) - { - throw new InvalidDataException("workflowInstanceId is a required property for TaskResult and cannot be null"); - } - else - { - this.WorkflowInstanceId = workflowInstanceId; - } + this.WorkflowInstanceId = workflowInstanceId; + this.TaskId = taskId; this.CallbackAfterSeconds = callbackAfterSeconds; this.ExternalOutputPayloadStoragePath = externalOutputPayloadStoragePath; this.Logs = logs; diff --git a/Conductor/Client/Models/WorkflowStateUpdate.cs b/Conductor/Client/Models/WorkflowStateUpdate.cs new file mode 100644 index 00000000..f1f35424 --- /dev/null +++ b/Conductor/Client/Models/WorkflowStateUpdate.cs @@ -0,0 +1,140 @@ +using System; +using System.Text; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using System.Linq; + +namespace Conductor.Client.Models +{ + /// + /// WorkflowStateUpdate + /// + [DataContract] + public partial class WorkflowStateUpdate : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// taskReferenceName. + /// taskResult. + /// variables. + public WorkflowStateUpdate(string taskReferenceName = default(string), TaskResult taskResult = default(TaskResult), Dictionary variables = default(Dictionary)) + { + this.TaskReferenceName = taskReferenceName; + this.TaskResult = taskResult; + this.Variables = variables; + } + + /// + /// Gets or Sets TaskReferenceName + /// + [DataMember(Name="taskReferenceName", EmitDefaultValue=false)] + public string TaskReferenceName { get; set; } + + /// + /// Gets or Sets TaskResult + /// + [DataMember(Name="taskResult", EmitDefaultValue=false)] + public TaskResult TaskResult { get; set; } + + /// + /// Gets or Sets Variables + /// + [DataMember(Name="variables", EmitDefaultValue=false)] + public Dictionary Variables { 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 WorkflowStateUpdate {\n"); + sb.Append(" TaskReferenceName: ").Append(TaskReferenceName).Append("\n"); + sb.Append(" TaskResult: ").Append(TaskResult).Append("\n"); + sb.Append(" Variables: ").Append(Variables).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 WorkflowStateUpdate); + } + + /// + /// Returns true if WorkflowStateUpdate instances are equal + /// + /// Instance of WorkflowStateUpdate to be compared + /// Boolean + public bool Equals(WorkflowStateUpdate input) + { + if (input == null) + return false; + + return + ( + this.TaskReferenceName == input.TaskReferenceName || + (this.TaskReferenceName != null && + this.TaskReferenceName.Equals(input.TaskReferenceName)) + ) && + ( + this.TaskResult == input.TaskResult || + (this.TaskResult != null && + this.TaskResult.Equals(input.TaskResult)) + ) && + ( + this.Variables == input.Variables || + this.Variables != null && + input.Variables != null && + this.Variables.SequenceEqual(input.Variables) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TaskReferenceName != null) + hashCode = hashCode * 59 + this.TaskReferenceName.GetHashCode(); + if (this.TaskResult != null) + hashCode = hashCode * 59 + this.TaskResult.GetHashCode(); + if (this.Variables != null) + hashCode = hashCode * 59 + this.Variables.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Tests/Api/WorkflowResourceApiTest.cs b/Tests/Api/WorkflowResourceApiTest.cs index 343c3bc7..c53af19d 100644 --- a/Tests/Api/WorkflowResourceApiTest.cs +++ b/Tests/Api/WorkflowResourceApiTest.cs @@ -4,18 +4,23 @@ using Conductor.Client.Models; using Conductor.Definition; using Conductor.Definition.TaskType; -using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Threading; +using System.Threading.Tasks; +using Conductor.Client; +using Microsoft.Extensions.Logging; using Tests.Worker; using Xunit; +using Xunit.Abstractions; +using Task = Conductor.Client.Models.Task; namespace conductor_csharp.test.Api { public class WorkflowResourceApiTest { + private readonly ITestOutputHelper _testOutputHelper; private const string WORKFLOW_NAME = "TestToCreateVariables"; private const string TASK_NAME = "TestToCreateVariables_Task"; private const string WORKFLOW_VARIABLE_1 = "TestVariable1"; @@ -24,14 +29,151 @@ public class WorkflowResourceApiTest private const int WORKFLOW_VERSION = 1; private readonly WorkflowResourceApi _workflowClient; + private readonly ITaskResourceApi _taskClient; private readonly ILogger _logger; - public WorkflowResourceApiTest() + public WorkflowResourceApiTest(ITestOutputHelper testOutputHelper) { + _testOutputHelper = testOutputHelper; _workflowClient = ApiExtensions.GetClient(); + _taskClient = ApiExtensions.GetClient(); _logger = ApplicationLogging.CreateLogger(); } + [Fact] + public void TestWorkflowOperations() + { + // Start Workflow + var correlationId = Guid.NewGuid().ToString(); + var startWorkflowRequest = new StartWorkflowRequest + { + Name = "csharp_sync_task_variable_updates", + Version = 1, + Input = new Dictionary(), + CorrelationId = correlationId + }; + var workflowId = _workflowClient.StartWorkflow(startWorkflowRequest); + _testOutputHelper.WriteLine($"Started workflow with id {workflowId}"); + + // Update a variable inside the workflow + _workflowClient.UpdateWorkflowVariables(workflowId, new Dictionary { { "case", "case1" } }); + + // Get workflow execution status + Workflow workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); + Task lastTask = workflow.Tasks.Last(); + _testOutputHelper.WriteLine( + $"Workflow status is {workflow.Status} and currently running task is {lastTask.ReferenceTaskName}"); + + workflow = _taskClient.UpdateTaskSync(new Dictionary { { "a", "b" } }, workflowId, lastTask.ReferenceTaskName, TaskResult.StatusEnum.COMPLETED, "test_worker"); + + // Get updated workflow status + lastTask = workflow.Tasks.Last(); + Assert.Equal(lastTask.Status, Task.StatusEnum.INPROGRESS); + _testOutputHelper.WriteLine( + $"Workflow status is {workflow.Status} and currently running task is {lastTask.ReferenceTaskName}"); + + // Terminate the workflow + _workflowClient.Terminate(workflowId, reason: "testing termination"); + workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); + Assert.Equal(Workflow.StatusEnum.TERMINATED, workflow.Status); + lastTask = workflow.Tasks.Last(); + _testOutputHelper.WriteLine( + $"Workflow status is {workflow.Status} and status of last task {lastTask.Status}"); + + // Retry the workflow + _workflowClient.Retry(workflowId); + workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); + Assert.Equal(Workflow.StatusEnum.RUNNING, workflow.Status); + lastTask = workflow.Tasks.Last(); + _testOutputHelper.WriteLine( + $"Workflow status is {workflow.Status} and status of last task {lastTask.ReferenceTaskName} is {lastTask.Status}"); + + // Mark the WAIT task as completed by calling Task completion API + TaskResult taskResult = new TaskResult + { + WorkflowInstanceId = workflowId, + TaskId = lastTask.TaskId, + Status = TaskResult.StatusEnum.COMPLETED, + OutputData = new Dictionary { { "greetings", "hello from Orkes" } } + }; + workflow = _taskClient.UpdateTaskSync(new Dictionary { { "greetings", "hello from Orkes" } }, + workflowId, lastTask.ReferenceTaskName, TaskResult.StatusEnum.COMPLETED, ""); + + lastTask = workflow.Tasks.Last(); + Assert.Equal(Task.StatusEnum.SCHEDULED, lastTask.Status); + _testOutputHelper.WriteLine( + $"Workflow status is {workflow.Status} and status of last task {lastTask.ReferenceTaskName} is {lastTask.Status}"); + + // Terminate the workflow again + _workflowClient.Terminate(workflowId, reason: "terminating for testing"); + workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); + Assert.Equal(Workflow.StatusEnum.TERMINATED, workflow.Status); + + + // Rerun workflow from a specific task + RerunWorkflowRequest rerunRequest = new RerunWorkflowRequest + { + ReRunFromTaskId = workflow.Tasks[3].TaskId + }; + _workflowClient.Rerun(rerunRequest, workflowId); + workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); + Assert.Equal(Workflow.StatusEnum.RUNNING, workflow.Status); + + + // Restart the workflow + _workflowClient.Terminate(workflowId, reason: "terminating so we can do a restart"); + workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); + Assert.Equal(Workflow.StatusEnum.TERMINATED, workflow.Status); + + _workflowClient.Restart(workflowId); + workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); + Assert.Equal(Workflow.StatusEnum.RUNNING, workflow.Status); + + // Pause the workflow + _workflowClient.PauseWorkflow(workflowId); + workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); + Assert.Equal(Workflow.StatusEnum.PAUSED, workflow.Status); + _testOutputHelper.WriteLine($"Workflow status is {workflow.Status}"); + + workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); + // Wait task should have completed + Task waitTask = workflow.Tasks[0]; + Assert.Equal(Task.StatusEnum.INPROGRESS, waitTask.Status); + _testOutputHelper.WriteLine($"Workflow status is {workflow.Status} and wait task is {waitTask.Status}"); + + + // Because workflow is paused, no further task should have been scheduled, making WAIT the last task + // Expecting only 1 task + _testOutputHelper.WriteLine($"Number of tasks in workflow is {workflow.Tasks.Count}"); + Assert.Single(workflow.Tasks); + + // Resume the workflow + _workflowClient.ResumeWorkflow(workflowId); + lastTask = workflow.Tasks.Last(); + workflow = _taskClient.UpdateTaskSync(new Dictionary { { "a", "b" } }, workflowId, lastTask.ReferenceTaskName, TaskResult.StatusEnum.COMPLETED, "test_worker"); + + workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); + + // There should be 3 tasks + _testOutputHelper.WriteLine( + $"Number of tasks in workflow is {workflow.Tasks.Count} and last task is {workflow.Tasks.Last().ReferenceTaskName}"); + Assert.Equal(3, workflow.Tasks.Count); + + // Search for workflows + var searchResults = _workflowClient.Search(start: 0, size: 100, freeText: "*", + query: $"correlationId = '{correlationId}'"); + _testOutputHelper.WriteLine( + $"Found {searchResults.Results.Count} execution with correlation_id '{correlationId}'"); + Assert.Single(searchResults.Results); + + correlationId = Guid.NewGuid().ToString(); + searchResults = _workflowClient.Search(start: 0, size: 100, freeText: "*", + query: $"status IN (RUNNING) AND correlationId = \"{correlationId}\""); + // Shouldn't find anything! + _testOutputHelper.WriteLine( + $"Found {searchResults.Results.Count} workflows with correlation id {correlationId}"); + } + [Fact] public async void UpdateWorkflowVariables() { @@ -39,26 +181,132 @@ public async void UpdateWorkflowVariables() var _workflow = GetConductorWorkflow(); ApiExtensions.GetWorkflowExecutor().RegisterWorkflow(_workflow, true); var workflowId = ApiExtensions.GetWorkflowExecutor().StartWorkflow(_workflow); - await ExecuteWorkflowTasks(workflowCompletionTimeout: TimeSpan.FromSeconds(20)); - await ValidateWorkflowCompletion(workflowId); // Create variables collection with values to be updated - var updateDict = new Dictionary { - {WORKFLOW_VARIABLE_1,"Value1" }, - {WORKFLOW_VARIABLE_2,"Value2" }, + var updateDict = new Dictionary + { + { WORKFLOW_VARIABLE_1, "Value1" }, + { WORKFLOW_VARIABLE_2, "Value2" }, }; - var updateVariableData = new Workflow() { WorkflowId = workflowId, Variables = updateDict }; + // Update the work flow variables - _workflowClient.UpdateWorkflowVariables(updateVariableData); + _workflowClient.UpdateWorkflowVariables(workflowId, updateDict); // Fetch latest workflow data to validate the change in variables var _updatedWorkFlow = _workflowClient.GetWorkflowStatusSummary(workflowId, includeVariables: true); // Verify workflow variables data is equal with input passed Assert.Equal(_updatedWorkFlow.Variables, updateDict); } + [Fact] + public void TestUpdateWorkflowState() + { + var startWorkflowRequest = new StartWorkflowRequest + { + Name = "csharp_sync_task_variable_updates", + Version = 1, + Input = new Dictionary() + }; + var workflowRun = _workflowClient.ExecuteWorkflow(startWorkflowRequest, + Guid.NewGuid().ToString(), + startWorkflowRequest.Name, startWorkflowRequest.Version, + "wait_task_ref"); + + var workflowId = workflowRun.WorkflowId; + _testOutputHelper.WriteLine(workflowId); + + TaskResult taskResult = new TaskResult + { + OutputData = new Dictionary { { "a", "b" } } + }; + + WorkflowStateUpdate request = new WorkflowStateUpdate + { + TaskReferenceName = "wait_task_ref", + TaskResult = taskResult, + Variables = new Dictionary { { "case", "case1" } } + }; + + workflowRun = _workflowClient.UpdateWorkflow(workflowId, request, + new List { "wait_task_ref_1", "wait_task_ref_2" }, 10); + + _testOutputHelper.WriteLine(workflowRun.ToString()); + _testOutputHelper.WriteLine(workflowRun.Status.ToString()); + _testOutputHelper.WriteLine(workflowRun.Tasks + .Select(task => $"{task.ReferenceTaskName}:{task.Status}") + .ToList().ToString()); + + request = new WorkflowStateUpdate + { + TaskReferenceName = "wait_task_ref_2", + TaskResult = taskResult + }; + + workflowRun = _workflowClient.UpdateWorkflow(workflowId, request, new List(), 2); + Assert.Equal(WorkflowStatus.StatusEnum.RUNNING.ToString(), workflowRun.Status.ToString()); + + request = new WorkflowStateUpdate + { + TaskReferenceName = "simple_task_ref", + TaskResult = taskResult + }; + workflowRun = _workflowClient.UpdateWorkflow(workflowId, request, new List(), 2); + + var allTaskStatus = workflowRun.Tasks + .Select(t => t.Status) + .ToHashSet(); + + Assert.Single(allTaskStatus); + Assert.Equal(Task.StatusEnum.COMPLETED.ToString(), allTaskStatus.First().ToString()); + + _testOutputHelper.WriteLine(workflowRun.Status.ToString()); + _testOutputHelper.WriteLine(workflowRun.Tasks + .Select(task => $"{task.ReferenceTaskName}:{task.Status}") + .ToList().ToString()); + } + + + [Fact] + public void TestStartWorkflowConflict() + { + var startWorkflowRequest = new StartWorkflowRequest + { + Name = "csharp_sync_task_variable_updates", + Version = 1 + }; + + string idempotencyKey = Guid.NewGuid().ToString(); + startWorkflowRequest.IdempotencyKey = idempotencyKey; + startWorkflowRequest.IdempotencyStrategy = IdempotencyStrategy.FAIL; + + string workflowId = _workflowClient.StartWorkflow(startWorkflowRequest); + _testOutputHelper.WriteLine(workflowId); + + startWorkflowRequest.IdempotencyStrategy = IdempotencyStrategy.RETURN_EXISTING; + string workflowId2 = _workflowClient.StartWorkflow(startWorkflowRequest); + Assert.Equal(workflowId, workflowId2); + + startWorkflowRequest.IdempotencyStrategy = IdempotencyStrategy.FAIL; + bool conflict = false; + + try + { + _workflowClient.StartWorkflow(startWorkflowRequest); + } + catch (ApiException ce) + { + if (ce.ErrorCode == 409) + { + conflict = true; + } + } + + Assert.True(conflict); + } + private async System.Threading.Tasks.Task ExecuteWorkflowTasks(TimeSpan workflowCompletionTimeout) { - var host = WorkflowTaskHost.CreateWorkerHost(LogLevel.Information, new ClassWorker()); + var host = WorkflowTaskHost.CreateWorkerHost(LogLevel.Information, + new ClassWorker(taskType: "TestToCreateVariables_Task")); await host.StartAsync(); Thread.Sleep(workflowCompletionTimeout); await host.StopAsync(); @@ -94,4 +342,4 @@ private async System.Threading.Tasks.Task ValidateWorkflowCompletion(params stri Assert.Equal(0, incompleteWorkflowCounter); } } -} +} \ No newline at end of file diff --git a/Tests/Worker/Workers.cs b/Tests/Worker/Workers.cs index 0eb68054..b26ebc3f 100644 --- a/Tests/Worker/Workers.cs +++ b/Tests/Worker/Workers.cs @@ -1,63 +1,63 @@ -using Conductor.Client.Extensions; -using Conductor.Client.Interfaces; -using Conductor.Client.Models; -using Conductor.Client.Worker; using System; using System.Threading; using System.Threading.Tasks; +using Conductor.Client.Extensions; +using Conductor.Client.Interfaces; +using Conductor.Client.Worker; +using Conductor.Client.Models; +using Task = System.Threading.Tasks.Task; + +namespace Tests.Worker; -namespace Tests.Worker +[WorkerTask] +public class FunctionalWorkers { - [WorkerTask] - public class FunctionalWorkers + private static readonly Random _random; + + static FunctionalWorkers() + { + _random = new Random(); + } + + // Polls for 5 task every 200ms + [WorkerTask("test-sdk-csharp-task", 5, "taskDomain", 200, "workerId")] + public static TaskResult SimpleWorker(Conductor.Client.Models.Task task) { - private static Random _random; - - static FunctionalWorkers() - { - _random = new Random(); - } - - // Polls for 5 task every 200ms - [WorkerTask("test-sdk-csharp-task", 5, "taskDomain", 200, "workerId")] - public static TaskResult SimpleWorker(Conductor.Client.Models.Task task) - { - return task.Completed(); - } - - // Polls for 12 tasks every 420ms - [WorkerTask("test-sdk-csharp-task", 12, "taskDomain", 420, "workerId")] - public TaskResult LazyWorker(Conductor.Client.Models.Task task) - { - var timeSpan = System.TimeSpan.FromMilliseconds(_random.Next(128, 2048)); - System.Threading.Tasks.Task.Delay(timeSpan).GetAwaiter().GetResult(); - return task.Completed(); - } + return task.Completed(); } - public class ClassWorker : IWorkflowTask + // Polls for 12 tasks every 420ms + [WorkerTask("test-sdk-csharp-task", 12, "taskDomain", 420, "workerId")] + public TaskResult LazyWorker(Conductor.Client.Models.Task task) { - public string TaskType { get; } + var timeSpan = TimeSpan.FromMilliseconds(_random.Next(128, 2048)); + Task.Delay(timeSpan).GetAwaiter().GetResult(); + return task.Completed(); + } +} - public WorkflowTaskExecutorConfiguration WorkerSettings { get; } +public class ClassWorker : IWorkflowTask +{ + public ClassWorker(string taskType = "random_task_type") + { + TaskType = taskType; + WorkerSettings = new WorkflowTaskExecutorConfiguration(); + } - public ClassWorker(string taskType = "random_task_type") - { - TaskType = taskType; - WorkerSettings = new WorkflowTaskExecutorConfiguration(); - } + public string TaskType { get; } - public async Task Execute(Conductor.Client.Models.Task task, CancellationToken token) - { - if (token != CancellationToken.None && token.IsCancellationRequested) - throw new Exception("Token request Cancelled"); + public WorkflowTaskExecutorConfiguration WorkerSettings { get; } - throw new NotImplementedException(); - } + public async Task Execute(Conductor.Client.Models.Task task, CancellationToken token) + { + if (token != CancellationToken.None && token.IsCancellationRequested) + throw new Exception("Token request Cancelled"); + + return new TaskResult(status: TaskResult.StatusEnum.COMPLETED, taskId:task.TaskId, workflowInstanceId:task.WorkflowInstanceId); + } - public TaskResult Execute(Conductor.Client.Models.Task task) - { - throw new NotImplementedException(); - } + public TaskResult Execute(Conductor.Client.Models.Task task) + { + throw new NotImplementedException(); } -} +} \ No newline at end of file diff --git a/Tests/conductor-csharp.test.csproj b/Tests/conductor-csharp.test.csproj index e1b4a1d1..50d3857b 100644 --- a/Tests/conductor-csharp.test.csproj +++ b/Tests/conductor-csharp.test.csproj @@ -3,11 +3,13 @@ netcoreapp6.0 + + - + \ No newline at end of file From a586773ae8545e5897e7dd11739628d3c2e806ca Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Wed, 31 Jan 2024 13:38:44 -0800 Subject: [PATCH 3/4] Update WorkFlowExamples.cs --- csharp-examples/WorkFlowExamples.cs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/csharp-examples/WorkFlowExamples.cs b/csharp-examples/WorkFlowExamples.cs index 5922836e..f7ded8b0 100644 --- a/csharp-examples/WorkFlowExamples.cs +++ b/csharp-examples/WorkFlowExamples.cs @@ -14,7 +14,6 @@ public class WorkFlowExamples private const string KEY_SECRET = ""; private const string OWNER_EMAIL = ""; - private const string WORKFLOW_ID = ""; private const string WORKFLOW_NAME = ""; private const string WORKFLOW_DESCRIPTION = ""; private const string TASK_NAME = ""; @@ -22,9 +21,7 @@ public class WorkFlowExamples private const string VARIABLE_OLD_VALUE = "SOME_OLD_VALUE"; private const string VARIABLE_NAME_1 = ""; - private const string VARIABLE_NEW_VALUE_1 = ""; private const string VARIABLE_NAME_2 = ""; - private const string VARIABLE_NEW_VALUE_2 = ""; public void RegisterWorkFlow() @@ -55,23 +52,7 @@ private ConductorWorkflow GetConductorWorkflow() return conductorWorkFlow; } - public void UpdateWorkflowVariablesWithWorkFlowId() - { - var orkesApiClient = new OrkesApiClient(new Configuration(), - new OrkesAuthenticationSettings(KEY_ID, KEY_SECRET)); - var workflowClient = orkesApiClient.GetClient(); - var workFlowVariables = new Dictionary - { - { VARIABLE_NAME_1, VARIABLE_NEW_VALUE_1 }, - { VARIABLE_NAME_2, VARIABLE_NEW_VALUE_2 } - }; - - workflowClient.UpdateWorkflowVariables(new Conductor.Client.Models.Workflow() - { - WorkflowId = WORKFLOW_ID, - Variables = workFlowVariables - }); - } + } } From 4de5effeb60218aee3f15303ced1df9aabdef479 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Wed, 31 Jan 2024 14:33:56 -0800 Subject: [PATCH 4/4] formatting --- Conductor/Api/ApplicationResourceApi.cs | 1284 +++++++---------- Conductor/Api/AuthorizationResourceApi.cs | 312 ++-- Conductor/Api/EventResourceApi.cs | 781 ++++------ Conductor/Api/GroupResourceApi.cs | 883 +++++------- Conductor/Api/IApplicationResourceApi.cs | 343 +++++ Conductor/Api/IAuthorizationResourceApi.cs | 80 + Conductor/Api/IEventResourceApi.cs | 211 +++ Conductor/Api/IGroupResourceApi.cs | 234 +++ Conductor/Api/IMetadataResourceApi.cs | 271 ++++ Conductor/Api/ISchedulerResourceApi.cs | 341 +++++ Conductor/Api/ISecretResourceApi.cs | 226 +++ Conductor/Api/ITagsApi.cs | 215 +++ Conductor/Api/ITaskResourceApi.cs | 431 ++++++ Conductor/Api/IWorkflowBulkResourceApi.cs | 126 ++ Conductor/Api/IWorkflowResourceApi.cs | 16 +- Conductor/Api/MetadataResourceApi.cs | 1002 +++++-------- Conductor/Api/SchedulerResourceApi.cs | 1259 +++++++--------- Conductor/Api/SecretResourceApi.cs | 835 ++++------- Conductor/Api/TagsApi.cs | 790 ++++------ Conductor/Api/TaskResourceApi.cs | 424 ------ Conductor/Api/WorkflowBulkResourceApi.cs | 120 -- Conductor/Api/WorkflowResourceApi.cs | 28 +- .../Client/Models/StartWorkflowRequest.cs | 14 +- .../Client/Models/WorkflowStateUpdate.cs | 29 +- Conductor/conductor-csharp.csproj | 40 +- Tests/Api/WorkflowResourceApiTest.cs | 604 ++++---- Tests/Client/OrkesApiClientTest.cs | 25 +- Tests/Definition/WorkflowDefinitionTests.cs | 301 ++-- Tests/Worker/WorkerTests.cs | 142 +- Tests/Worker/Workers.cs | 7 +- Tests/conductor-csharp.test.csproj | 26 +- csharp-examples/Runner.cs | 8 +- csharp-examples/TestWorker.cs | 3 +- csharp-examples/WorkFlowExamples.cs | 2 +- csharp-examples/csharp-examples.csproj | 28 +- 35 files changed, 5837 insertions(+), 5604 deletions(-) create mode 100644 Conductor/Api/IApplicationResourceApi.cs create mode 100644 Conductor/Api/IAuthorizationResourceApi.cs create mode 100644 Conductor/Api/IEventResourceApi.cs create mode 100644 Conductor/Api/IGroupResourceApi.cs create mode 100644 Conductor/Api/IMetadataResourceApi.cs create mode 100644 Conductor/Api/ISchedulerResourceApi.cs create mode 100644 Conductor/Api/ISecretResourceApi.cs create mode 100644 Conductor/Api/ITagsApi.cs create mode 100644 Conductor/Api/ITaskResourceApi.cs create mode 100644 Conductor/Api/IWorkflowBulkResourceApi.cs diff --git a/Conductor/Api/ApplicationResourceApi.cs b/Conductor/Api/ApplicationResourceApi.cs index 6cb93351..0573adaf 100644 --- a/Conductor/Api/ApplicationResourceApi.cs +++ b/Conductor/Api/ApplicationResourceApi.cs @@ -1,796 +1,463 @@ using System; using System.Collections.Generic; using System.Linq; -using RestSharp; using Conductor.Client; using Conductor.Client.Models; +using RestSharp; namespace Conductor.Api { /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public interface IApplicationResourceApi : IApiAccessor + public class ApplicationResourceApi : IApplicationResourceApi { - #region Synchronous Operations - /// - /// - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object AddRoleToApplicationUser(string applicationId, string role); + private ExceptionFactory _exceptionFactory = (name, response) => null; /// - /// - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse AddRoleToApplicationUserWithHttpInfo(string applicationId, string role); - /// - /// Create an access key for an application + /// Initializes a new instance of the class. /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object CreateAccessKey(string id); - - /// - /// Create an access key for an application - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse CreateAccessKeyWithHttpInfo(string id); - /// - /// Create an application - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object CreateApplication(CreateOrUpdateApplicationRequest body); - - /// - /// Create an application - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse CreateApplicationWithHttpInfo(CreateOrUpdateApplicationRequest body); - /// - /// Delete an access key - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object DeleteAccessKey(string applicationId, string keyId); - - /// - /// Delete an access key - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse DeleteAccessKeyWithHttpInfo(string applicationId, string keyId); - /// - /// Delete an application - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object DeleteApplication(string id); - - /// - /// Delete an application - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse DeleteApplicationWithHttpInfo(string id); - /// - /// Delete a tag for application - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// /// - void DeleteTagForApplication(List body, string id); - - /// - /// Delete a tag for application - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object(void) - ApiResponse DeleteTagForApplicationWithHttpInfo(List body, string id); - /// - /// Get application's access keys - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object GetAccessKeys(string id); - - /// - /// Get application's access keys - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse GetAccessKeysWithHttpInfo(string id); - /// - /// Get application id by access key id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object GetAppByAccessKeyId(string accessKeyId); - - /// - /// Get application id by access key id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse GetAppByAccessKeyIdWithHttpInfo(string accessKeyId); - /// - /// Get an application by id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object GetApplication(string id); - - /// - /// Get an application by id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse GetApplicationWithHttpInfo(string id); - /// - /// Get tags by application - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// List<TagObject> - List GetTagsForApplication(string id); - - /// - /// Get tags by application - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of List<TagObject> - ApiResponse> GetTagsForApplicationWithHttpInfo(string id); - /// - /// Get all applications - /// - /// - /// - /// - /// Thrown when fails to make API call - /// List<ExtendedConductorApplication> - List ListApplications(); - - /// - /// Get all applications - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of List<ExtendedConductorApplication> - ApiResponse> ListApplicationsWithHttpInfo(); - /// - /// Put a tag to application - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - void PutTagForApplication(List body, string id); - - /// - /// Put a tag to application - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object(void) - ApiResponse PutTagForApplicationWithHttpInfo(List body, string id); - /// - /// - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object RemoveRoleFromApplicationUser(string applicationId, string role); - - /// - /// - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse RemoveRoleFromApplicationUserWithHttpInfo(string applicationId, string role); - /// - /// Toggle the status of an access key - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object ToggleAccessKeyStatus(string applicationId, string keyId); - - /// - /// Toggle the status of an access key - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse ToggleAccessKeyStatusWithHttpInfo(string applicationId, string keyId); - /// - /// Update an application - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object UpdateApplication(CreateOrUpdateApplicationRequest body, string id); - - /// - /// Update an application - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse UpdateApplicationWithHttpInfo(CreateOrUpdateApplicationRequest body, string id); - #endregion Synchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class ApplicationResourceApi : IApplicationResourceApi - { - private Conductor.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public ApplicationResourceApi(String basePath) + public ApplicationResourceApi(string basePath) { - this.Configuration = new Conductor.Client.Configuration { BasePath = basePath }; + Configuration = new Configuration { BasePath = basePath }; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// /// public ApplicationResourceApi() { - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class - /// using Configuration object + /// Initializes a new instance of the class + /// using Configuration object /// /// An instance of Configuration /// - public ApplicationResourceApi(Conductor.Client.Configuration configuration = null) + public ApplicationResourceApi(Configuration configuration = null) { if (configuration == null) // use the default one in Configuration - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; else - this.Configuration = configuration; + 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.BaseUrl.ToString(); + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Gets or sets the configuration object + /// Gets or sets the configuration object /// /// An instance of the Configuration - public Conductor.Client.Configuration Configuration { get; set; } + public Configuration Configuration { get; set; } /// - /// Provides a factory method hook for the creation of exceptions. + /// Provides a factory method hook for the creation of exceptions. /// - public Conductor.Client.ExceptionFactory ExceptionFactory + public ExceptionFactory ExceptionFactory { get { if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } return _exceptionFactory; } - set { _exceptionFactory = value; } + set => _exceptionFactory = value; } /// - /// /// /// Thrown when fails to make API call /// /// /// Object - public Object AddRoleToApplicationUser(string applicationId, string role) + public object AddRoleToApplicationUser(string applicationId, string role) { - ApiResponse localVarResponse = AddRoleToApplicationUserWithHttpInfo(applicationId, role); + var localVarResponse = AddRoleToApplicationUserWithHttpInfo(applicationId, role); return localVarResponse.Data; } /// - /// /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse AddRoleToApplicationUserWithHttpInfo(string applicationId, string role) + public ApiResponse AddRoleToApplicationUserWithHttpInfo(string applicationId, string role) { // verify the required parameter 'applicationId' is set if (applicationId == null) - throw new ApiException(400, "Missing required parameter 'applicationId' when calling ApplicationResourceApi->AddRoleToApplicationUser"); + throw new ApiException(400, + "Missing required parameter 'applicationId' when calling ApplicationResourceApi->AddRoleToApplicationUser"); // verify the required parameter 'role' is set if (role == null) - throw new ApiException(400, "Missing required parameter 'role' when calling ApplicationResourceApi->AddRoleToApplicationUser"); + throw new ApiException(400, + "Missing required parameter 'role' when calling ApplicationResourceApi->AddRoleToApplicationUser"); var localVarPath = "/applications/{applicationId}/roles/{role}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (applicationId != null) localVarPathParams.Add("applicationId", this.Configuration.ApiClient.ParameterToString(applicationId)); // path parameter - if (role != null) localVarPathParams.Add("role", this.Configuration.ApiClient.ParameterToString(role)); // path parameter + if (applicationId != null) + localVarPathParams.Add("applicationId", + Configuration.ApiClient.ParameterToString(applicationId)); // path parameter + if (role != null) + localVarPathParams.Add("role", Configuration.ApiClient.ParameterToString(role)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("AddRoleToApplicationUser", localVarResponse); + var exception = ExceptionFactory("AddRoleToApplicationUser", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Create an access key for an application + /// Create an access key for an application /// /// Thrown when fails to make API call /// /// Object - public Object CreateAccessKey(string id) + public object CreateAccessKey(string id) { - ApiResponse localVarResponse = CreateAccessKeyWithHttpInfo(id); + var localVarResponse = CreateAccessKeyWithHttpInfo(id); return localVarResponse.Data; } /// - /// Create an access key for an application + /// Create an access key for an application /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse CreateAccessKeyWithHttpInfo(string id) + public ApiResponse CreateAccessKeyWithHttpInfo(string id) { // verify the required parameter 'id' is set if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ApplicationResourceApi->CreateAccessKey"); + throw new ApiException(400, + "Missing required parameter 'id' when calling ApplicationResourceApi->CreateAccessKey"); var localVarPath = "/applications/{id}/accessKeys"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter + if (id != null) + localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("CreateAccessKey", localVarResponse); + var exception = ExceptionFactory("CreateAccessKey", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Create an application + /// Create an application /// /// Thrown when fails to make API call /// /// Object - public Object CreateApplication(CreateOrUpdateApplicationRequest body) + public object CreateApplication(CreateOrUpdateApplicationRequest body) { - ApiResponse localVarResponse = CreateApplicationWithHttpInfo(body); + var localVarResponse = CreateApplicationWithHttpInfo(body); return localVarResponse.Data; } /// - /// Create an application + /// Create an application /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse CreateApplicationWithHttpInfo(CreateOrUpdateApplicationRequest body) + public ApiResponse CreateApplicationWithHttpInfo(CreateOrUpdateApplicationRequest body) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling ApplicationResourceApi->CreateApplication"); + throw new ApiException(400, + "Missing required parameter 'body' when calling ApplicationResourceApi->CreateApplication"); var localVarPath = "/applications"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("CreateApplication", localVarResponse); + var exception = ExceptionFactory("CreateApplication", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Delete an access key + /// Delete an access key /// /// Thrown when fails to make API call /// /// /// Object - public Object DeleteAccessKey(string applicationId, string keyId) + public object DeleteAccessKey(string applicationId, string keyId) { - ApiResponse localVarResponse = DeleteAccessKeyWithHttpInfo(applicationId, keyId); + var localVarResponse = DeleteAccessKeyWithHttpInfo(applicationId, keyId); return localVarResponse.Data; } /// - /// Delete an access key + /// Delete an access key /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse DeleteAccessKeyWithHttpInfo(string applicationId, string keyId) + public ApiResponse DeleteAccessKeyWithHttpInfo(string applicationId, string keyId) { // verify the required parameter 'applicationId' is set if (applicationId == null) - throw new ApiException(400, "Missing required parameter 'applicationId' when calling ApplicationResourceApi->DeleteAccessKey"); + throw new ApiException(400, + "Missing required parameter 'applicationId' when calling ApplicationResourceApi->DeleteAccessKey"); // verify the required parameter 'keyId' is set if (keyId == null) - throw new ApiException(400, "Missing required parameter 'keyId' when calling ApplicationResourceApi->DeleteAccessKey"); + throw new ApiException(400, + "Missing required parameter 'keyId' when calling ApplicationResourceApi->DeleteAccessKey"); var localVarPath = "/applications/{applicationId}/accessKeys/{keyId}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (applicationId != null) localVarPathParams.Add("applicationId", this.Configuration.ApiClient.ParameterToString(applicationId)); // path parameter - if (keyId != null) localVarPathParams.Add("keyId", this.Configuration.ApiClient.ParameterToString(keyId)); // path parameter + if (applicationId != null) + localVarPathParams.Add("applicationId", + Configuration.ApiClient.ParameterToString(applicationId)); // path parameter + if (keyId != null) + localVarPathParams.Add("keyId", Configuration.ApiClient.ParameterToString(keyId)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("DeleteAccessKey", localVarResponse); + var exception = ExceptionFactory("DeleteAccessKey", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Delete an application + /// Delete an application /// /// Thrown when fails to make API call /// /// Object - public Object DeleteApplication(string id) + public object DeleteApplication(string id) { - ApiResponse localVarResponse = DeleteApplicationWithHttpInfo(id); + var localVarResponse = DeleteApplicationWithHttpInfo(id); return localVarResponse.Data; } /// - /// Delete an application + /// Delete an application /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse DeleteApplicationWithHttpInfo(string id) + public ApiResponse DeleteApplicationWithHttpInfo(string id) { // verify the required parameter 'id' is set if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ApplicationResourceApi->DeleteApplication"); + throw new ApiException(400, + "Missing required parameter 'id' when calling ApplicationResourceApi->DeleteApplication"); var localVarPath = "/applications/{id}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter + if (id != null) + localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("DeleteApplication", localVarResponse); + var exception = ExceptionFactory("DeleteApplication", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Delete a tag for application + /// Delete a tag for application /// /// Thrown when fails to make API call /// @@ -802,299 +469,309 @@ public void DeleteTagForApplication(List body, string id) } /// - /// Delete a tag for application + /// Delete a tag for application /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object(void) - public ApiResponse DeleteTagForApplicationWithHttpInfo(List body, string id) + public ApiResponse DeleteTagForApplicationWithHttpInfo(List body, string id) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling ApplicationResourceApi->DeleteTagForApplication"); + throw new ApiException(400, + "Missing required parameter 'body' when calling ApplicationResourceApi->DeleteTagForApplication"); // verify the required parameter 'id' is set if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ApplicationResourceApi->DeleteTagForApplication"); + throw new ApiException(400, + "Missing required parameter 'id' when calling ApplicationResourceApi->DeleteTagForApplication"); var localVarPath = "/applications/{id}/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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter + if (id != null) + localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("DeleteTagForApplication", localVarResponse); + var exception = ExceptionFactory("DeleteTagForApplication", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// - /// Get application's access keys + /// Get application's access keys /// /// Thrown when fails to make API call /// /// Object - public Object GetAccessKeys(string id) + public object GetAccessKeys(string id) { - ApiResponse localVarResponse = GetAccessKeysWithHttpInfo(id); + var localVarResponse = GetAccessKeysWithHttpInfo(id); return localVarResponse.Data; } /// - /// Get application's access keys + /// Get application's access keys /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse GetAccessKeysWithHttpInfo(string id) + public ApiResponse GetAccessKeysWithHttpInfo(string id) { // verify the required parameter 'id' is set if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ApplicationResourceApi->GetAccessKeys"); + throw new ApiException(400, + "Missing required parameter 'id' when calling ApplicationResourceApi->GetAccessKeys"); var localVarPath = "/applications/{id}/accessKeys"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter + if (id != null) + localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetAccessKeys", localVarResponse); + var exception = ExceptionFactory("GetAccessKeys", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Get application id by access key id + /// Get application id by access key id /// /// Thrown when fails to make API call /// /// Object - public Object GetAppByAccessKeyId(string accessKeyId) + public object GetAppByAccessKeyId(string accessKeyId) { - ApiResponse localVarResponse = GetAppByAccessKeyIdWithHttpInfo(accessKeyId); + var localVarResponse = GetAppByAccessKeyIdWithHttpInfo(accessKeyId); return localVarResponse.Data; } /// - /// Get application id by access key id + /// Get application id by access key id /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse GetAppByAccessKeyIdWithHttpInfo(string accessKeyId) + public ApiResponse GetAppByAccessKeyIdWithHttpInfo(string accessKeyId) { // verify the required parameter 'accessKeyId' is set if (accessKeyId == null) - throw new ApiException(400, "Missing required parameter 'accessKeyId' when calling ApplicationResourceApi->GetAppByAccessKeyId"); + throw new ApiException(400, + "Missing required parameter 'accessKeyId' when calling ApplicationResourceApi->GetAppByAccessKeyId"); var localVarPath = "/applications/key/{accessKeyId}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (accessKeyId != null) localVarPathParams.Add("accessKeyId", this.Configuration.ApiClient.ParameterToString(accessKeyId)); // path parameter + if (accessKeyId != null) + localVarPathParams.Add("accessKeyId", + Configuration.ApiClient.ParameterToString(accessKeyId)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetAppByAccessKeyId", localVarResponse); + var exception = ExceptionFactory("GetAppByAccessKeyId", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Get an application by id + /// Get an application by id /// /// Thrown when fails to make API call /// /// Object - public Object GetApplication(string id) + public object GetApplication(string id) { - ApiResponse localVarResponse = GetApplicationWithHttpInfo(id); + var localVarResponse = GetApplicationWithHttpInfo(id); return localVarResponse.Data; } /// - /// Get an application by id + /// Get an application by id /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse GetApplicationWithHttpInfo(string id) + public ApiResponse GetApplicationWithHttpInfo(string id) { // verify the required parameter 'id' is set if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ApplicationResourceApi->GetApplication"); + throw new ApiException(400, + "Missing required parameter 'id' when calling ApplicationResourceApi->GetApplication"); var localVarPath = "/applications/{id}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter + if (id != null) + localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetApplication", localVarResponse); + var exception = ExceptionFactory("GetApplication", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Get tags by application + /// Get tags by application /// /// Thrown when fails to make API call /// /// List<TagObject> public List GetTagsForApplication(string id) { - ApiResponse> localVarResponse = GetTagsForApplicationWithHttpInfo(id); + var localVarResponse = GetTagsForApplicationWithHttpInfo(id); return localVarResponse.Data; } /// - /// Get tags by application + /// Get tags by application /// /// Thrown when fails to make API call /// @@ -1103,120 +780,124 @@ public ApiResponse> GetTagsForApplicationWithHttpInfo(string id) { // verify the required parameter 'id' is set if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ApplicationResourceApi->GetTagsForApplication"); + throw new ApiException(400, + "Missing required parameter 'id' when calling ApplicationResourceApi->GetTagsForApplication"); var localVarPath = "/applications/{id}/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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter + if (id != null) + localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetTagsForApplication", localVarResponse); + var exception = ExceptionFactory("GetTagsForApplication", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// - /// Get all applications + /// Get all applications /// /// Thrown when fails to make API call /// List<ExtendedConductorApplication> public List ListApplications() { - ApiResponse> localVarResponse = ListApplicationsWithHttpInfo(); + var localVarResponse = ListApplicationsWithHttpInfo(); return localVarResponse.Data; } /// - /// Get all applications + /// Get all applications /// /// Thrown when fails to make API call /// ApiResponse of List<ExtendedConductorApplication> public ApiResponse> ListApplicationsWithHttpInfo() { - var localVarPath = "/applications"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("ListApplications", localVarResponse); + var exception = ExceptionFactory("ListApplications", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, + typeof(List))); } /// - /// Put a tag to application + /// Put a tag to application /// /// Thrown when fails to make API call /// @@ -1228,309 +909,328 @@ public void PutTagForApplication(List body, string id) } /// - /// Put a tag to application + /// Put a tag to application /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object(void) - public ApiResponse PutTagForApplicationWithHttpInfo(List body, string id) + public ApiResponse PutTagForApplicationWithHttpInfo(List body, string id) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling ApplicationResourceApi->PutTagForApplication"); + throw new ApiException(400, + "Missing required parameter 'body' when calling ApplicationResourceApi->PutTagForApplication"); // verify the required parameter 'id' is set if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ApplicationResourceApi->PutTagForApplication"); + throw new ApiException(400, + "Missing required parameter 'id' when calling ApplicationResourceApi->PutTagForApplication"); var localVarPath = "/applications/{id}/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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter + if (id != null) + localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("PutTagForApplication", localVarResponse); + var exception = ExceptionFactory("PutTagForApplication", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// - /// /// /// Thrown when fails to make API call /// /// /// Object - public Object RemoveRoleFromApplicationUser(string applicationId, string role) + public object RemoveRoleFromApplicationUser(string applicationId, string role) { - ApiResponse localVarResponse = RemoveRoleFromApplicationUserWithHttpInfo(applicationId, role); + var localVarResponse = RemoveRoleFromApplicationUserWithHttpInfo(applicationId, role); return localVarResponse.Data; } /// - /// /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse RemoveRoleFromApplicationUserWithHttpInfo(string applicationId, string role) + public ApiResponse RemoveRoleFromApplicationUserWithHttpInfo(string applicationId, string role) { // verify the required parameter 'applicationId' is set if (applicationId == null) - throw new ApiException(400, "Missing required parameter 'applicationId' when calling ApplicationResourceApi->RemoveRoleFromApplicationUser"); + throw new ApiException(400, + "Missing required parameter 'applicationId' when calling ApplicationResourceApi->RemoveRoleFromApplicationUser"); // verify the required parameter 'role' is set if (role == null) - throw new ApiException(400, "Missing required parameter 'role' when calling ApplicationResourceApi->RemoveRoleFromApplicationUser"); + throw new ApiException(400, + "Missing required parameter 'role' when calling ApplicationResourceApi->RemoveRoleFromApplicationUser"); var localVarPath = "/applications/{applicationId}/roles/{role}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (applicationId != null) localVarPathParams.Add("applicationId", this.Configuration.ApiClient.ParameterToString(applicationId)); // path parameter - if (role != null) localVarPathParams.Add("role", this.Configuration.ApiClient.ParameterToString(role)); // path parameter + if (applicationId != null) + localVarPathParams.Add("applicationId", + Configuration.ApiClient.ParameterToString(applicationId)); // path parameter + if (role != null) + localVarPathParams.Add("role", Configuration.ApiClient.ParameterToString(role)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("RemoveRoleFromApplicationUser", localVarResponse); + var exception = ExceptionFactory("RemoveRoleFromApplicationUser", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Toggle the status of an access key + /// Toggle the status of an access key /// /// Thrown when fails to make API call /// /// /// Object - public Object ToggleAccessKeyStatus(string applicationId, string keyId) + public object ToggleAccessKeyStatus(string applicationId, string keyId) { - ApiResponse localVarResponse = ToggleAccessKeyStatusWithHttpInfo(applicationId, keyId); + var localVarResponse = ToggleAccessKeyStatusWithHttpInfo(applicationId, keyId); return localVarResponse.Data; } /// - /// Toggle the status of an access key + /// Toggle the status of an access key /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse ToggleAccessKeyStatusWithHttpInfo(string applicationId, string keyId) + public ApiResponse ToggleAccessKeyStatusWithHttpInfo(string applicationId, string keyId) { // verify the required parameter 'applicationId' is set if (applicationId == null) - throw new ApiException(400, "Missing required parameter 'applicationId' when calling ApplicationResourceApi->ToggleAccessKeyStatus"); + throw new ApiException(400, + "Missing required parameter 'applicationId' when calling ApplicationResourceApi->ToggleAccessKeyStatus"); // verify the required parameter 'keyId' is set if (keyId == null) - throw new ApiException(400, "Missing required parameter 'keyId' when calling ApplicationResourceApi->ToggleAccessKeyStatus"); + throw new ApiException(400, + "Missing required parameter 'keyId' when calling ApplicationResourceApi->ToggleAccessKeyStatus"); var localVarPath = "/applications/{applicationId}/accessKeys/{keyId}/status"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (applicationId != null) localVarPathParams.Add("applicationId", this.Configuration.ApiClient.ParameterToString(applicationId)); // path parameter - if (keyId != null) localVarPathParams.Add("keyId", this.Configuration.ApiClient.ParameterToString(keyId)); // path parameter + if (applicationId != null) + localVarPathParams.Add("applicationId", + Configuration.ApiClient.ParameterToString(applicationId)); // path parameter + if (keyId != null) + localVarPathParams.Add("keyId", Configuration.ApiClient.ParameterToString(keyId)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("ToggleAccessKeyStatus", localVarResponse); + var exception = ExceptionFactory("ToggleAccessKeyStatus", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Update an application + /// Update an application /// /// Thrown when fails to make API call /// /// /// Object - public Object UpdateApplication(CreateOrUpdateApplicationRequest body, string id) + public object UpdateApplication(CreateOrUpdateApplicationRequest body, string id) { - ApiResponse localVarResponse = UpdateApplicationWithHttpInfo(body, id); + var localVarResponse = UpdateApplicationWithHttpInfo(body, id); return localVarResponse.Data; } /// - /// Update an application + /// Update an application /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse UpdateApplicationWithHttpInfo(CreateOrUpdateApplicationRequest body, string id) + public ApiResponse UpdateApplicationWithHttpInfo(CreateOrUpdateApplicationRequest body, string id) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling ApplicationResourceApi->UpdateApplication"); + throw new ApiException(400, + "Missing required parameter 'body' when calling ApplicationResourceApi->UpdateApplication"); // verify the required parameter 'id' is set if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling ApplicationResourceApi->UpdateApplication"); + throw new ApiException(400, + "Missing required parameter 'id' when calling ApplicationResourceApi->UpdateApplication"); var localVarPath = "/applications/{id}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter + if (id != null) + localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("UpdateApplication", localVarResponse); + var exception = ExceptionFactory("UpdateApplication", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return Configuration.ApiClient.RestClient.BaseUrl.ToString(); } } -} +} \ No newline at end of file diff --git a/Conductor/Api/AuthorizationResourceApi.cs b/Conductor/Api/AuthorizationResourceApi.cs index 6ac7e8ab..4f1d1c0a 100644 --- a/Conductor/Api/AuthorizationResourceApi.cs +++ b/Conductor/Api/AuthorizationResourceApi.cs @@ -1,253 +1,172 @@ using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Linq; -using RestSharp; using Conductor.Client; using Conductor.Client.Models; +using RestSharp; namespace Conductor.Api { /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IAuthorizationResourceApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Get the access that have been granted over the given object - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object GetPermissions(string type, string id); - - /// - /// Get the access that have been granted over the given object - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse GetPermissionsWithHttpInfo(string type, string id); - /// - /// Grant access to a user over the target - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Response - Response GrantPermissions(AuthorizationRequest body); - - /// - /// Grant access to a user over the target - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Response - ApiResponse GrantPermissionsWithHttpInfo(AuthorizationRequest body); - /// - /// Remove user's access over the target - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Response - Response RemovePermissions(AuthorizationRequest body); - - /// - /// Remove user's access over the target - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Response - ApiResponse RemovePermissionsWithHttpInfo(AuthorizationRequest body); - #endregion Synchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public partial class AuthorizationResourceApi : IAuthorizationResourceApi + public class AuthorizationResourceApi : IAuthorizationResourceApi { - private Conductor.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + private ExceptionFactory _exceptionFactory = (name, response) => null; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - public AuthorizationResourceApi(String basePath) + public AuthorizationResourceApi(string basePath) { - this.Configuration = new Conductor.Client.Configuration { BasePath = basePath }; + Configuration = new Configuration { BasePath = basePath }; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// /// public AuthorizationResourceApi() { - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class - /// using Configuration object + /// Initializes a new instance of the class + /// using Configuration object /// /// An instance of Configuration /// - public AuthorizationResourceApi(Conductor.Client.Configuration configuration = null) + public AuthorizationResourceApi(Configuration configuration = null) { if (configuration == null) // use the default one in Configuration - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; else - this.Configuration = configuration; + Configuration = configuration; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Gets or sets the configuration object + /// Gets or sets the configuration object /// /// An instance of the Configuration - public Conductor.Client.Configuration Configuration { get; set; } + public Configuration Configuration { get; set; } /// - /// Provides a factory method hook for the creation of exceptions. + /// Provides a factory method hook for the creation of exceptions. /// - public Conductor.Client.ExceptionFactory ExceptionFactory + public ExceptionFactory ExceptionFactory { get { if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } return _exceptionFactory; } - set { _exceptionFactory = value; } + set => _exceptionFactory = value; } /// - /// Get the access that have been granted over the given object + /// Get the access that have been granted over the given object /// /// Thrown when fails to make API call /// /// /// Object - public Object GetPermissions(string type, string id) + public object GetPermissions(string type, string id) { - ApiResponse localVarResponse = GetPermissionsWithHttpInfo(type, id); + var localVarResponse = GetPermissionsWithHttpInfo(type, id); return localVarResponse.Data; } /// - /// Get the access that have been granted over the given object + /// Get the access that have been granted over the given object /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse GetPermissionsWithHttpInfo(string type, string id) + public ApiResponse GetPermissionsWithHttpInfo(string type, string id) { // verify the required parameter 'type' is set if (type == null) - throw new ApiException(400, "Missing required parameter 'type' when calling AuthorizationResourceApi->GetPermissions"); + throw new ApiException(400, + "Missing required parameter 'type' when calling AuthorizationResourceApi->GetPermissions"); // verify the required parameter 'id' is set if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling AuthorizationResourceApi->GetPermissions"); + throw new ApiException(400, + "Missing required parameter 'id' when calling AuthorizationResourceApi->GetPermissions"); var localVarPath = "/auth/authorization/{type}/{id}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (type != null) localVarPathParams.Add("type", this.Configuration.ApiClient.ParameterToString(type)); // path parameter - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter + if (type != null) + localVarPathParams.Add("type", Configuration.ApiClient.ParameterToString(type)); // path parameter + if (id != null) + localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetPermissions", localVarResponse); + var exception = ExceptionFactory("GetPermissions", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Grant access to a user over the target + /// Grant access to a user over the target /// /// Thrown when fails to make API call /// /// Response public Response GrantPermissions(AuthorizationRequest body) { - ApiResponse localVarResponse = GrantPermissionsWithHttpInfo(body); + var localVarResponse = GrantPermissionsWithHttpInfo(body); return localVarResponse.Data; } /// - /// Grant access to a user over the target + /// Grant access to a user over the target /// /// Thrown when fails to make API call /// @@ -256,76 +175,74 @@ public ApiResponse GrantPermissionsWithHttpInfo(AuthorizationRequest b { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling AuthorizationResourceApi->GrantPermissions"); + throw new ApiException(400, + "Missing required parameter 'body' when calling AuthorizationResourceApi->GrantPermissions"); var localVarPath = "/auth/authorization"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GrantPermissions", localVarResponse); + var exception = ExceptionFactory("GrantPermissions", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Response)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Response))); + (Response)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Response))); } /// - /// Remove user's access over the target + /// Remove user's access over the target /// /// Thrown when fails to make API call /// /// Response public Response RemovePermissions(AuthorizationRequest body) { - ApiResponse localVarResponse = RemovePermissionsWithHttpInfo(body); + var localVarResponse = RemovePermissionsWithHttpInfo(body); return localVarResponse.Data; } /// - /// Remove user's access over the target + /// Remove user's access over the target /// /// Thrown when fails to make API call /// @@ -334,60 +251,67 @@ public ApiResponse RemovePermissionsWithHttpInfo(AuthorizationRequest { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling AuthorizationResourceApi->RemovePermissions"); + throw new ApiException(400, + "Missing required parameter 'body' when calling AuthorizationResourceApi->RemovePermissions"); var localVarPath = "/auth/authorization"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("RemovePermissions", localVarResponse); + var exception = ExceptionFactory("RemovePermissions", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Response)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Response))); + (Response)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Response))); + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return Configuration.ApiClient.RestClient.BaseUrl.ToString(); } } -} +} \ No newline at end of file diff --git a/Conductor/Api/EventResourceApi.cs b/Conductor/Api/EventResourceApi.cs index d4037457..26172512 100644 --- a/Conductor/Api/EventResourceApi.cs +++ b/Conductor/Api/EventResourceApi.cs @@ -1,294 +1,79 @@ using System; using System.Collections.Generic; using System.Linq; -using RestSharp; using Conductor.Client; +using RestSharp; using EventHandler = Conductor.Client.Models.EventHandler; namespace Conductor.Api { /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IEventResourceApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Add a new event handler. - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - void AddEventHandler(EventHandler body); - - /// - /// Add a new event handler. - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - ApiResponse AddEventHandlerWithHttpInfo(EventHandler body); - /// - /// Delete queue config by name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - void DeleteQueueConfig(string queueType, string queueName); - - /// - /// Delete queue config by name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object(void) - ApiResponse DeleteQueueConfigWithHttpInfo(string queueType, string queueName); - /// - /// Get all the event handlers - /// - /// - /// - /// - /// Thrown when fails to make API call - /// List<EventHandler> - List GetEventHandlers(); - - /// - /// Get all the event handlers - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of List<EventHandler> - ApiResponse> GetEventHandlersWithHttpInfo(); - /// - /// Get event handlers for a given event - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to true) - /// List<EventHandler> - List GetEventHandlersForEvent(string _event, bool? activeOnly = null); - - /// - /// Get event handlers for a given event - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to true) - /// ApiResponse of List<EventHandler> - ApiResponse> GetEventHandlersForEventWithHttpInfo(string _event, bool? activeOnly = null); - /// - /// Get queue config by name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Dictionary<string, Object> - Dictionary GetQueueConfig(string queueType, string queueName); - - /// - /// Get queue config by name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Dictionary<string, Object> - ApiResponse> GetQueueConfigWithHttpInfo(string queueType, string queueName); - /// - /// Get all queue configs - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Dictionary<string, string> - Dictionary GetQueueNames(); - - /// - /// Get all queue configs - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, string> - ApiResponse> GetQueueNamesWithHttpInfo(); - /// - /// Create or update queue config by name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - /// - void PutQueueConfig(string body, string queueType, string queueName); - - /// - /// Create or update queue config by name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - /// ApiResponse of Object(void) - ApiResponse PutQueueConfigWithHttpInfo(string body, string queueType, string queueName); - /// - /// Remove an event handler - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - void RemoveEventHandlerStatus(string name); - - /// - /// Remove an event handler - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - ApiResponse RemoveEventHandlerStatusWithHttpInfo(string name); - /// - /// Update an existing event handler. - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - void UpdateEventHandler(EventHandler body); - - /// - /// Update an existing event handler. - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - ApiResponse UpdateEventHandlerWithHttpInfo(EventHandler body); - #endregion Synchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public partial class EventResourceApi : IEventResourceApi + public class EventResourceApi : IEventResourceApi { - private Conductor.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + private ExceptionFactory _exceptionFactory = (name, response) => null; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - public EventResourceApi(String basePath) + public EventResourceApi(string basePath) { - this.Configuration = new Conductor.Client.Configuration { BasePath = basePath }; + Configuration = new Configuration { BasePath = basePath }; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// /// public EventResourceApi() { - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class - /// using Configuration object + /// Initializes a new instance of the class + /// using Configuration object /// /// An instance of Configuration /// - public EventResourceApi(Conductor.Client.Configuration configuration = null) + public EventResourceApi(Configuration configuration = null) { if (configuration == null) // use the default one in Configuration - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; else - this.Configuration = configuration; + Configuration = configuration; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Gets or sets the configuration object + /// Gets or sets the configuration object /// /// An instance of the Configuration - public Conductor.Client.Configuration Configuration { get; set; } + public Configuration Configuration { get; set; } /// - /// Provides a factory method hook for the creation of exceptions. + /// Provides a factory method hook for the creation of exceptions. /// - public Conductor.Client.ExceptionFactory ExceptionFactory + public ExceptionFactory ExceptionFactory { get { if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } return _exceptionFactory; } - set { _exceptionFactory = value; } + set => _exceptionFactory = value; } /// - /// Add a new event handler. + /// Add a new event handler. /// /// Thrown when fails to make API call /// @@ -299,72 +84,70 @@ public void AddEventHandler(EventHandler body) } /// - /// Add a new event handler. + /// Add a new event handler. /// /// Thrown when fails to make API call /// /// ApiResponse of Object(void) - public ApiResponse AddEventHandlerWithHttpInfo(EventHandler body) + public ApiResponse AddEventHandlerWithHttpInfo(EventHandler body) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling EventResourceApi->AddEventHandler"); + throw new ApiException(400, + "Missing required parameter 'body' when calling EventResourceApi->AddEventHandler"); var localVarPath = "/event"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("AddEventHandler", localVarResponse); + var exception = ExceptionFactory("AddEventHandler", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// - /// Delete queue config by name + /// Delete queue config by name /// /// Thrown when fails to make API call /// @@ -376,133 +159,140 @@ public void DeleteQueueConfig(string queueType, string queueName) } /// - /// Delete queue config by name + /// Delete queue config by name /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object(void) - public ApiResponse DeleteQueueConfigWithHttpInfo(string queueType, string queueName) + public ApiResponse DeleteQueueConfigWithHttpInfo(string queueType, string queueName) { // verify the required parameter 'queueType' is set if (queueType == null) - throw new ApiException(400, "Missing required parameter 'queueType' when calling EventResourceApi->DeleteQueueConfig"); + throw new ApiException(400, + "Missing required parameter 'queueType' when calling EventResourceApi->DeleteQueueConfig"); // verify the required parameter 'queueName' is set if (queueName == null) - throw new ApiException(400, "Missing required parameter 'queueName' when calling EventResourceApi->DeleteQueueConfig"); + throw new ApiException(400, + "Missing required parameter 'queueName' when calling EventResourceApi->DeleteQueueConfig"); var localVarPath = "/event/queue/config/{queueType}/{queueName}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (queueType != null) localVarPathParams.Add("queueType", this.Configuration.ApiClient.ParameterToString(queueType)); // path parameter - if (queueName != null) localVarPathParams.Add("queueName", this.Configuration.ApiClient.ParameterToString(queueName)); // path parameter - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (queueType != null) + localVarPathParams.Add("queueType", + Configuration.ApiClient.ParameterToString(queueType)); // path parameter + if (queueName != null) + localVarPathParams.Add("queueName", + Configuration.ApiClient.ParameterToString(queueName)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("DeleteQueueConfig", localVarResponse); + var exception = ExceptionFactory("DeleteQueueConfig", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// - /// Get all the event handlers + /// Get all the event handlers /// /// Thrown when fails to make API call /// List<EventHandler> public List GetEventHandlers() { - ApiResponse> localVarResponse = GetEventHandlersWithHttpInfo(); + var localVarResponse = GetEventHandlersWithHttpInfo(); return localVarResponse.Data; } /// - /// Get all the event handlers + /// Get all the event handlers /// /// Thrown when fails to make API call /// ApiResponse of List<EventHandler> public ApiResponse> GetEventHandlersWithHttpInfo() { - var localVarPath = "/event"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetEventHandlers", localVarResponse); + var exception = ExceptionFactory("GetEventHandlers", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// - /// Get event handlers for a given event + /// Get event handlers for a given event /// /// Thrown when fails to make API call /// @@ -510,212 +300,227 @@ public ApiResponse> GetEventHandlersWithHttpInfo() /// List<EventHandler> public List GetEventHandlersForEvent(string _event, bool? activeOnly = null) { - ApiResponse> localVarResponse = GetEventHandlersForEventWithHttpInfo(_event, activeOnly); + var localVarResponse = GetEventHandlersForEventWithHttpInfo(_event, activeOnly); return localVarResponse.Data; } /// - /// Get event handlers for a given event + /// Get event handlers for a given event /// /// Thrown when fails to make API call /// /// (optional, default to true) /// ApiResponse of List<EventHandler> - public ApiResponse> GetEventHandlersForEventWithHttpInfo(string _event, bool? activeOnly = null) + public ApiResponse> GetEventHandlersForEventWithHttpInfo(string _event, + bool? activeOnly = null) { // verify the required parameter '_event' is set if (_event == null) - throw new ApiException(400, "Missing required parameter '_event' when calling EventResourceApi->GetEventHandlersForEvent"); + throw new ApiException(400, + "Missing required parameter '_event' when calling EventResourceApi->GetEventHandlersForEvent"); var localVarPath = "/event/{event}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (_event != null) localVarPathParams.Add("event", this.Configuration.ApiClient.ParameterToString(_event)); // 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; - } + if (_event != null) + localVarPathParams.Add("event", Configuration.ApiClient.ParameterToString(_event)); // path parameter + if (activeOnly != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "activeOnly", activeOnly)); // query parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetEventHandlersForEvent", localVarResponse); + var exception = ExceptionFactory("GetEventHandlersForEvent", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// - /// Get queue config by name + /// Get queue config by name /// /// Thrown when fails to make API call /// /// /// Dictionary<string, Object> - public Dictionary GetQueueConfig(string queueType, string queueName) + public Dictionary GetQueueConfig(string queueType, string queueName) { - ApiResponse> localVarResponse = GetQueueConfigWithHttpInfo(queueType, queueName); + var localVarResponse = GetQueueConfigWithHttpInfo(queueType, queueName); return localVarResponse.Data; } /// - /// Get queue config by name + /// Get queue config by name /// /// Thrown when fails to make API call /// /// /// ApiResponse of Dictionary<string, Object> - public ApiResponse> GetQueueConfigWithHttpInfo(string queueType, string queueName) + public ApiResponse> GetQueueConfigWithHttpInfo(string queueType, string queueName) { // verify the required parameter 'queueType' is set if (queueType == null) - throw new ApiException(400, "Missing required parameter 'queueType' when calling EventResourceApi->GetQueueConfig"); + throw new ApiException(400, + "Missing required parameter 'queueType' when calling EventResourceApi->GetQueueConfig"); // verify the required parameter 'queueName' is set if (queueName == null) - throw new ApiException(400, "Missing required parameter 'queueName' when calling EventResourceApi->GetQueueConfig"); + throw new ApiException(400, + "Missing required parameter 'queueName' when calling EventResourceApi->GetQueueConfig"); var localVarPath = "/event/queue/config/{queueType}/{queueName}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (queueType != null) localVarPathParams.Add("queueType", this.Configuration.ApiClient.ParameterToString(queueType)); // path parameter - if (queueName != null) localVarPathParams.Add("queueName", this.Configuration.ApiClient.ParameterToString(queueName)); // path parameter - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (queueType != null) + localVarPathParams.Add("queueType", + Configuration.ApiClient.ParameterToString(queueType)); // path parameter + if (queueName != null) + localVarPathParams.Add("queueName", + Configuration.ApiClient.ParameterToString(queueName)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetQueueConfig", localVarResponse); + var exception = ExceptionFactory("GetQueueConfig", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, + return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Dictionary)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + (Dictionary)Configuration.ApiClient.Deserialize(localVarResponse, + typeof(Dictionary))); } /// - /// Get all queue configs + /// Get all queue configs /// /// Thrown when fails to make API call /// Dictionary<string, string> public Dictionary GetQueueNames() { - ApiResponse> localVarResponse = GetQueueNamesWithHttpInfo(); + var localVarResponse = GetQueueNamesWithHttpInfo(); return localVarResponse.Data; } /// - /// Get all queue configs + /// Get all queue configs /// /// Thrown when fails to make API call /// ApiResponse of Dictionary<string, string> public ApiResponse> GetQueueNamesWithHttpInfo() { - var localVarPath = "/event/queue/config"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetQueueNames", localVarResponse); + var exception = ExceptionFactory("GetQueueNames", 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))); + (Dictionary)Configuration.ApiClient.Deserialize(localVarResponse, + typeof(Dictionary))); } /// - /// Create or update queue config by name + /// Create or update queue config by name /// /// Thrown when fails to make API call /// @@ -728,82 +533,86 @@ public void PutQueueConfig(string body, string queueType, string queueName) } /// - /// Create or update queue config by name + /// Create or update queue config by name /// /// Thrown when fails to make API call /// /// /// /// ApiResponse of Object(void) - public ApiResponse PutQueueConfigWithHttpInfo(string body, string queueType, string queueName) + public ApiResponse PutQueueConfigWithHttpInfo(string body, string queueType, string queueName) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling EventResourceApi->PutQueueConfig"); + throw new ApiException(400, + "Missing required parameter 'body' when calling EventResourceApi->PutQueueConfig"); // verify the required parameter 'queueType' is set if (queueType == null) - throw new ApiException(400, "Missing required parameter 'queueType' when calling EventResourceApi->PutQueueConfig"); + throw new ApiException(400, + "Missing required parameter 'queueType' when calling EventResourceApi->PutQueueConfig"); // verify the required parameter 'queueName' is set if (queueName == null) - throw new ApiException(400, "Missing required parameter 'queueName' when calling EventResourceApi->PutQueueConfig"); + throw new ApiException(400, + "Missing required parameter 'queueName' when calling EventResourceApi->PutQueueConfig"); var localVarPath = "/event/queue/config/{queueType}/{queueName}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (queueType != null) localVarPathParams.Add("queueType", this.Configuration.ApiClient.ParameterToString(queueType)); // path parameter - if (queueName != null) localVarPathParams.Add("queueName", this.Configuration.ApiClient.ParameterToString(queueName)); // path parameter + if (queueType != null) + localVarPathParams.Add("queueType", + Configuration.ApiClient.ParameterToString(queueType)); // path parameter + if (queueName != null) + localVarPathParams.Add("queueName", + Configuration.ApiClient.ParameterToString(queueName)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("PutQueueConfig", localVarResponse); + var exception = ExceptionFactory("PutQueueConfig", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// - /// Remove an event handler + /// Remove an event handler /// /// Thrown when fails to make API call /// @@ -814,64 +623,67 @@ public void RemoveEventHandlerStatus(string name) } /// - /// Remove an event handler + /// Remove an event handler /// /// Thrown when fails to make API call /// /// ApiResponse of Object(void) - public ApiResponse RemoveEventHandlerStatusWithHttpInfo(string name) + public ApiResponse RemoveEventHandlerStatusWithHttpInfo(string name) { // verify the required parameter 'name' is set if (name == null) - throw new ApiException(400, "Missing required parameter 'name' when calling EventResourceApi->RemoveEventHandlerStatus"); + throw new ApiException(400, + "Missing required parameter 'name' when calling EventResourceApi->RemoveEventHandlerStatus"); var localVarPath = "/event/{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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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; - } + if (name != null) + localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("RemoveEventHandlerStatus", localVarResponse); + var exception = ExceptionFactory("RemoveEventHandlerStatus", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// - /// Update an existing event handler. + /// Update an existing event handler. /// /// Thrown when fails to make API call /// @@ -882,68 +694,75 @@ public void UpdateEventHandler(EventHandler body) } /// - /// Update an existing event handler. + /// Update an existing event handler. /// /// Thrown when fails to make API call /// /// ApiResponse of Object(void) - public ApiResponse UpdateEventHandlerWithHttpInfo(EventHandler body) + public ApiResponse UpdateEventHandlerWithHttpInfo(EventHandler body) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling EventResourceApi->UpdateEventHandler"); + throw new ApiException(400, + "Missing required parameter 'body' when calling EventResourceApi->UpdateEventHandler"); var localVarPath = "/event"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("UpdateEventHandler", localVarResponse); + var exception = ExceptionFactory("UpdateEventHandler", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } } -} +} \ No newline at end of file diff --git a/Conductor/Api/GroupResourceApi.cs b/Conductor/Api/GroupResourceApi.cs index 251b006e..29f267d0 100644 --- a/Conductor/Api/GroupResourceApi.cs +++ b/Conductor/Api/GroupResourceApi.cs @@ -1,394 +1,160 @@ using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Linq; -using RestSharp; using Conductor.Client; using Conductor.Client.Models; +using RestSharp; namespace Conductor.Api { /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IGroupResourceApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Add user to group - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object AddUserToGroup(string groupId, string userId); - - /// - /// Add user to group - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse AddUserToGroupWithHttpInfo(string groupId, string userId); - /// - /// Add users to group - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - void AddUsersToGroup(List body, string groupId); - - /// - /// Add users to group - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object(void) - ApiResponse AddUsersToGroupWithHttpInfo(List body, string groupId); - /// - /// Delete a group - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Response - Response DeleteGroup(string id); - - /// - /// Delete a group - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Response - ApiResponse DeleteGroupWithHttpInfo(string id); - /// - /// Get the permissions this group has over workflows and tasks - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object GetGrantedPermissions(string groupId); - - /// - /// Get the permissions this group has over workflows and tasks - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse GetGrantedPermissionsWithHttpInfo(string groupId); - /// - /// Get a group by id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object GetGroup(string id); - - /// - /// Get a group by id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse GetGroupWithHttpInfo(string id); - /// - /// Get all users in group - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object GetUsersInGroup(string id); - - /// - /// Get all users in group - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse GetUsersInGroupWithHttpInfo(string id); - /// - /// Get all groups - /// - /// - /// - /// - /// Thrown when fails to make API call - /// List<Group> - List ListGroups(); - - /// - /// Get all groups - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of List<Group> - ApiResponse> ListGroupsWithHttpInfo(); - /// - /// Remove user from group - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object RemoveUserFromGroup(string groupId, string userId); - - /// - /// Remove user from group - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse RemoveUserFromGroupWithHttpInfo(string groupId, string userId); - /// - /// Remove users from group - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - void RemoveUsersFromGroup(List body, string groupId); - - /// - /// Remove users from group - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object(void) - ApiResponse RemoveUsersFromGroupWithHttpInfo(List body, string groupId); - /// - /// Create or update a group - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object UpsertGroup(UpsertGroupRequest body, string id); - - /// - /// Create or update a group - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse UpsertGroupWithHttpInfo(UpsertGroupRequest body, string id); - #endregion Synchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public partial class GroupResourceApi : IGroupResourceApi + public class GroupResourceApi : IGroupResourceApi { - private Conductor.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + private ExceptionFactory _exceptionFactory = (name, response) => null; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - public GroupResourceApi(String basePath) + public GroupResourceApi(string basePath) { - this.Configuration = new Conductor.Client.Configuration { BasePath = basePath }; + Configuration = new Configuration { BasePath = basePath }; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// /// public GroupResourceApi() { - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class - /// using Configuration object + /// Initializes a new instance of the class + /// using Configuration object /// /// An instance of Configuration /// - public GroupResourceApi(Conductor.Client.Configuration configuration = null) + public GroupResourceApi(Configuration configuration = null) { if (configuration == null) // use the default one in Configuration - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; else - this.Configuration = configuration; - - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; - } + Configuration = configuration; - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Gets or sets the configuration object + /// Gets or sets the configuration object /// /// An instance of the Configuration - public Conductor.Client.Configuration Configuration { get; set; } + public Configuration Configuration { get; set; } /// - /// Provides a factory method hook for the creation of exceptions. + /// Provides a factory method hook for the creation of exceptions. /// - public Conductor.Client.ExceptionFactory ExceptionFactory + public ExceptionFactory ExceptionFactory { get { if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } return _exceptionFactory; } - set { _exceptionFactory = value; } + set => _exceptionFactory = value; } /// - /// Add user to group + /// Add user to group /// /// Thrown when fails to make API call /// /// /// Object - public Object AddUserToGroup(string groupId, string userId) + public object AddUserToGroup(string groupId, string userId) { - ApiResponse localVarResponse = AddUserToGroupWithHttpInfo(groupId, userId); + var localVarResponse = AddUserToGroupWithHttpInfo(groupId, userId); return localVarResponse.Data; } /// - /// Add user to group + /// Add user to group /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse AddUserToGroupWithHttpInfo(string groupId, string userId) + public ApiResponse AddUserToGroupWithHttpInfo(string groupId, string userId) { // verify the required parameter 'groupId' is set if (groupId == null) - throw new ApiException(400, "Missing required parameter 'groupId' when calling GroupResourceApi->AddUserToGroup"); + throw new ApiException(400, + "Missing required parameter 'groupId' when calling GroupResourceApi->AddUserToGroup"); // verify the required parameter 'userId' is set if (userId == null) - throw new ApiException(400, "Missing required parameter 'userId' when calling GroupResourceApi->AddUserToGroup"); + throw new ApiException(400, + "Missing required parameter 'userId' when calling GroupResourceApi->AddUserToGroup"); var localVarPath = "/groups/{groupId}/users/{userId}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (groupId != null) localVarPathParams.Add("groupId", this.Configuration.ApiClient.ParameterToString(groupId)); // path parameter - if (userId != null) localVarPathParams.Add("userId", this.Configuration.ApiClient.ParameterToString(userId)); // path parameter - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (groupId != null) + localVarPathParams.Add("groupId", Configuration.ApiClient.ParameterToString(groupId)); // path parameter + if (userId != null) + localVarPathParams.Add("userId", Configuration.ApiClient.ParameterToString(userId)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("AddUserToGroup", localVarResponse); + var exception = ExceptionFactory("AddUserToGroup", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Add users to group + /// Add users to group /// /// Thrown when fails to make API call /// @@ -400,89 +166,89 @@ public void AddUsersToGroup(List body, string groupId) } /// - /// Add users to group + /// Add users to group /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object(void) - public ApiResponse AddUsersToGroupWithHttpInfo(List body, string groupId) + public ApiResponse AddUsersToGroupWithHttpInfo(List body, string groupId) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling GroupResourceApi->AddUsersToGroup"); + throw new ApiException(400, + "Missing required parameter 'body' when calling GroupResourceApi->AddUsersToGroup"); // verify the required parameter 'groupId' is set if (groupId == null) - throw new ApiException(400, "Missing required parameter 'groupId' when calling GroupResourceApi->AddUsersToGroup"); + throw new ApiException(400, + "Missing required parameter 'groupId' when calling GroupResourceApi->AddUsersToGroup"); var localVarPath = "/groups/{groupId}/users"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (groupId != null) localVarPathParams.Add("groupId", this.Configuration.ApiClient.ParameterToString(groupId)); // path parameter + if (groupId != null) + localVarPathParams.Add("groupId", Configuration.ApiClient.ParameterToString(groupId)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("AddUsersToGroup", localVarResponse); + var exception = ExceptionFactory("AddUsersToGroup", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// - /// Delete a group + /// Delete a group /// /// Thrown when fails to make API call /// /// Response public Response DeleteGroup(string id) { - ApiResponse localVarResponse = DeleteGroupWithHttpInfo(id); + var localVarResponse = DeleteGroupWithHttpInfo(id); return localVarResponse.Data; } /// - /// Delete a group + /// Delete a group /// /// Thrown when fails to make API call /// @@ -491,406 +257,422 @@ public ApiResponse DeleteGroupWithHttpInfo(string id) { // verify the required parameter 'id' is set if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling GroupResourceApi->DeleteGroup"); + throw new ApiException(400, + "Missing required parameter 'id' when calling GroupResourceApi->DeleteGroup"); var localVarPath = "/groups/{id}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (id != null) + localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("DeleteGroup", localVarResponse); + var exception = ExceptionFactory("DeleteGroup", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Response)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Response))); + (Response)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Response))); } /// - /// Get the permissions this group has over workflows and tasks + /// Get the permissions this group has over workflows and tasks /// /// Thrown when fails to make API call /// /// Object - public Object GetGrantedPermissions(string groupId) + public object GetGrantedPermissions(string groupId) { - ApiResponse localVarResponse = GetGrantedPermissionsWithHttpInfo(groupId); + var localVarResponse = GetGrantedPermissionsWithHttpInfo(groupId); return localVarResponse.Data; } /// - /// Get the permissions this group has over workflows and tasks + /// Get the permissions this group has over workflows and tasks /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse GetGrantedPermissionsWithHttpInfo(string groupId) + public ApiResponse GetGrantedPermissionsWithHttpInfo(string groupId) { // verify the required parameter 'groupId' is set if (groupId == null) - throw new ApiException(400, "Missing required parameter 'groupId' when calling GroupResourceApi->GetGrantedPermissions"); + throw new ApiException(400, + "Missing required parameter 'groupId' when calling GroupResourceApi->GetGrantedPermissions"); var localVarPath = "/groups/{groupId}/permissions"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (groupId != null) localVarPathParams.Add("groupId", this.Configuration.ApiClient.ParameterToString(groupId)); // path parameter - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (groupId != null) + localVarPathParams.Add("groupId", Configuration.ApiClient.ParameterToString(groupId)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetGrantedPermissions", localVarResponse); + var exception = ExceptionFactory("GetGrantedPermissions", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Get a group by id + /// Get a group by id /// /// Thrown when fails to make API call /// /// Object - public Object GetGroup(string id) + public object GetGroup(string id) { - ApiResponse localVarResponse = GetGroupWithHttpInfo(id); + var localVarResponse = GetGroupWithHttpInfo(id); return localVarResponse.Data; } /// - /// Get a group by id + /// Get a group by id /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse GetGroupWithHttpInfo(string id) + public ApiResponse GetGroupWithHttpInfo(string id) { // verify the required parameter 'id' is set if (id == null) throw new ApiException(400, "Missing required parameter 'id' when calling GroupResourceApi->GetGroup"); var localVarPath = "/groups/{id}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (id != null) + localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetGroup", localVarResponse); + var exception = ExceptionFactory("GetGroup", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Get all users in group + /// Get all users in group /// /// Thrown when fails to make API call /// /// Object - public Object GetUsersInGroup(string id) + public object GetUsersInGroup(string id) { - ApiResponse localVarResponse = GetUsersInGroupWithHttpInfo(id); + var localVarResponse = GetUsersInGroupWithHttpInfo(id); return localVarResponse.Data; } /// - /// Get all users in group + /// Get all users in group /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse GetUsersInGroupWithHttpInfo(string id) + public ApiResponse GetUsersInGroupWithHttpInfo(string id) { // verify the required parameter 'id' is set if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling GroupResourceApi->GetUsersInGroup"); + throw new ApiException(400, + "Missing required parameter 'id' when calling GroupResourceApi->GetUsersInGroup"); var localVarPath = "/groups/{id}/users"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (id != null) + localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetUsersInGroup", localVarResponse); + var exception = ExceptionFactory("GetUsersInGroup", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Get all groups + /// Get all groups /// /// Thrown when fails to make API call /// List<Group> public List ListGroups() { - ApiResponse> localVarResponse = ListGroupsWithHttpInfo(); + var localVarResponse = ListGroupsWithHttpInfo(); return localVarResponse.Data; } /// - /// Get all groups + /// Get all groups /// /// Thrown when fails to make API call /// ApiResponse of List<Group> public ApiResponse> ListGroupsWithHttpInfo() { - var localVarPath = "/groups"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("ListGroups", localVarResponse); + var exception = ExceptionFactory("ListGroups", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// - /// Remove user from group + /// Remove user from group /// /// Thrown when fails to make API call /// /// /// Object - public Object RemoveUserFromGroup(string groupId, string userId) + public object RemoveUserFromGroup(string groupId, string userId) { - ApiResponse localVarResponse = RemoveUserFromGroupWithHttpInfo(groupId, userId); + var localVarResponse = RemoveUserFromGroupWithHttpInfo(groupId, userId); return localVarResponse.Data; } /// - /// Remove user from group + /// Remove user from group /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse RemoveUserFromGroupWithHttpInfo(string groupId, string userId) + public ApiResponse RemoveUserFromGroupWithHttpInfo(string groupId, string userId) { // verify the required parameter 'groupId' is set if (groupId == null) - throw new ApiException(400, "Missing required parameter 'groupId' when calling GroupResourceApi->RemoveUserFromGroup"); + throw new ApiException(400, + "Missing required parameter 'groupId' when calling GroupResourceApi->RemoveUserFromGroup"); // verify the required parameter 'userId' is set if (userId == null) - throw new ApiException(400, "Missing required parameter 'userId' when calling GroupResourceApi->RemoveUserFromGroup"); + throw new ApiException(400, + "Missing required parameter 'userId' when calling GroupResourceApi->RemoveUserFromGroup"); var localVarPath = "/groups/{groupId}/users/{userId}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (groupId != null) localVarPathParams.Add("groupId", this.Configuration.ApiClient.ParameterToString(groupId)); // path parameter - if (userId != null) localVarPathParams.Add("userId", this.Configuration.ApiClient.ParameterToString(userId)); // path parameter - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (groupId != null) + localVarPathParams.Add("groupId", Configuration.ApiClient.ParameterToString(groupId)); // path parameter + if (userId != null) + localVarPathParams.Add("userId", Configuration.ApiClient.ParameterToString(userId)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("RemoveUserFromGroup", localVarResponse); + var exception = ExceptionFactory("RemoveUserFromGroup", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Remove users from group + /// Remove users from group /// /// Thrown when fails to make API call /// @@ -902,157 +684,166 @@ public void RemoveUsersFromGroup(List body, string groupId) } /// - /// Remove users from group + /// Remove users from group /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object(void) - public ApiResponse RemoveUsersFromGroupWithHttpInfo(List body, string groupId) + public ApiResponse RemoveUsersFromGroupWithHttpInfo(List body, string groupId) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling GroupResourceApi->RemoveUsersFromGroup"); + throw new ApiException(400, + "Missing required parameter 'body' when calling GroupResourceApi->RemoveUsersFromGroup"); // verify the required parameter 'groupId' is set if (groupId == null) - throw new ApiException(400, "Missing required parameter 'groupId' when calling GroupResourceApi->RemoveUsersFromGroup"); + throw new ApiException(400, + "Missing required parameter 'groupId' when calling GroupResourceApi->RemoveUsersFromGroup"); var localVarPath = "/groups/{groupId}/users"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (groupId != null) localVarPathParams.Add("groupId", this.Configuration.ApiClient.ParameterToString(groupId)); // path parameter + if (groupId != null) + localVarPathParams.Add("groupId", Configuration.ApiClient.ParameterToString(groupId)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("RemoveUsersFromGroup", localVarResponse); + var exception = ExceptionFactory("RemoveUsersFromGroup", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// - /// Create or update a group + /// Create or update a group /// /// Thrown when fails to make API call /// /// /// Object - public Object UpsertGroup(UpsertGroupRequest body, string id) + public object UpsertGroup(UpsertGroupRequest body, string id) { - ApiResponse localVarResponse = UpsertGroupWithHttpInfo(body, id); + var localVarResponse = UpsertGroupWithHttpInfo(body, id); return localVarResponse.Data; } /// - /// Create or update a group + /// Create or update a group /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse UpsertGroupWithHttpInfo(UpsertGroupRequest body, string id) + public ApiResponse UpsertGroupWithHttpInfo(UpsertGroupRequest body, string id) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling GroupResourceApi->UpsertGroup"); + throw new ApiException(400, + "Missing required parameter 'body' when calling GroupResourceApi->UpsertGroup"); // verify the required parameter 'id' is set if (id == null) - throw new ApiException(400, "Missing required parameter 'id' when calling GroupResourceApi->UpsertGroup"); + throw new ApiException(400, + "Missing required parameter 'id' when calling GroupResourceApi->UpsertGroup"); var localVarPath = "/groups/{id}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (id != null) localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter + if (id != null) + localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("UpsertGroup", localVarResponse); + var exception = ExceptionFactory("UpsertGroup", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return Configuration.ApiClient.RestClient.BaseUrl.ToString(); } } -} +} \ No newline at end of file diff --git a/Conductor/Api/IApplicationResourceApi.cs b/Conductor/Api/IApplicationResourceApi.cs new file mode 100644 index 00000000..c507b8ff --- /dev/null +++ b/Conductor/Api/IApplicationResourceApi.cs @@ -0,0 +1,343 @@ +using System; +using System.Collections.Generic; +using Conductor.Client; +using Conductor.Client.Models; + +namespace Conductor.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IApplicationResourceApi : IApiAccessor + { + #region Synchronous Operations + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object AddRoleToApplicationUser(string applicationId, string role); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse AddRoleToApplicationUserWithHttpInfo(string applicationId, string role); + /// + /// Create an access key for an application + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object CreateAccessKey(string id); + + /// + /// Create an access key for an application + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse CreateAccessKeyWithHttpInfo(string id); + /// + /// Create an application + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object CreateApplication(CreateOrUpdateApplicationRequest body); + + /// + /// Create an application + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse CreateApplicationWithHttpInfo(CreateOrUpdateApplicationRequest body); + /// + /// Delete an access key + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object DeleteAccessKey(string applicationId, string keyId); + + /// + /// Delete an access key + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse DeleteAccessKeyWithHttpInfo(string applicationId, string keyId); + /// + /// Delete an application + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object DeleteApplication(string id); + + /// + /// Delete an application + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse DeleteApplicationWithHttpInfo(string id); + /// + /// Delete a tag for application + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void DeleteTagForApplication(List body, string id); + + /// + /// Delete a tag for application + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse DeleteTagForApplicationWithHttpInfo(List body, string id); + /// + /// Get application's access keys + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object GetAccessKeys(string id); + + /// + /// Get application's access keys + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse GetAccessKeysWithHttpInfo(string id); + /// + /// Get application id by access key id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object GetAppByAccessKeyId(string accessKeyId); + + /// + /// Get application id by access key id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse GetAppByAccessKeyIdWithHttpInfo(string accessKeyId); + /// + /// Get an application by id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object GetApplication(string id); + + /// + /// Get an application by id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse GetApplicationWithHttpInfo(string id); + /// + /// Get tags by application + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// List<TagObject> + List GetTagsForApplication(string id); + + /// + /// Get tags by application + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<TagObject> + ApiResponse> GetTagsForApplicationWithHttpInfo(string id); + /// + /// Get all applications + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List<ExtendedConductorApplication> + List ListApplications(); + + /// + /// Get all applications + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of List<ExtendedConductorApplication> + ApiResponse> ListApplicationsWithHttpInfo(); + /// + /// Put a tag to application + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void PutTagForApplication(List body, string id); + + /// + /// Put a tag to application + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse PutTagForApplicationWithHttpInfo(List body, string id); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object RemoveRoleFromApplicationUser(string applicationId, string role); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse RemoveRoleFromApplicationUserWithHttpInfo(string applicationId, string role); + /// + /// Toggle the status of an access key + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object ToggleAccessKeyStatus(string applicationId, string keyId); + + /// + /// Toggle the status of an access key + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse ToggleAccessKeyStatusWithHttpInfo(string applicationId, string keyId); + /// + /// Update an application + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object UpdateApplication(CreateOrUpdateApplicationRequest body, string id); + + /// + /// Update an application + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse UpdateApplicationWithHttpInfo(CreateOrUpdateApplicationRequest body, string id); + #endregion Synchronous Operations + } +} \ No newline at end of file diff --git a/Conductor/Api/IAuthorizationResourceApi.cs b/Conductor/Api/IAuthorizationResourceApi.cs new file mode 100644 index 00000000..e84b9198 --- /dev/null +++ b/Conductor/Api/IAuthorizationResourceApi.cs @@ -0,0 +1,80 @@ +using System; +using Conductor.Client; +using Conductor.Client.Models; + +namespace Conductor.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IAuthorizationResourceApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Get the access that have been granted over the given object + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object GetPermissions(string type, string id); + + /// + /// Get the access that have been granted over the given object + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse GetPermissionsWithHttpInfo(string type, string id); + /// + /// Grant access to a user over the target + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Response + Response GrantPermissions(AuthorizationRequest body); + + /// + /// Grant access to a user over the target + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Response + ApiResponse GrantPermissionsWithHttpInfo(AuthorizationRequest body); + /// + /// Remove user's access over the target + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Response + Response RemovePermissions(AuthorizationRequest body); + + /// + /// Remove user's access over the target + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Response + ApiResponse RemovePermissionsWithHttpInfo(AuthorizationRequest body); + #endregion Synchronous Operations + } +} \ No newline at end of file diff --git a/Conductor/Api/IEventResourceApi.cs b/Conductor/Api/IEventResourceApi.cs new file mode 100644 index 00000000..c9fcbe70 --- /dev/null +++ b/Conductor/Api/IEventResourceApi.cs @@ -0,0 +1,211 @@ +using System; +using System.Collections.Generic; +using Conductor.Client; +using EventHandler = Conductor.Client.Models.EventHandler; + +namespace Conductor.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IEventResourceApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Add a new event handler. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + void AddEventHandler(EventHandler body); + + /// + /// Add a new event handler. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + ApiResponse AddEventHandlerWithHttpInfo(EventHandler body); + /// + /// Delete queue config by name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void DeleteQueueConfig(string queueType, string queueName); + + /// + /// Delete queue config by name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse DeleteQueueConfigWithHttpInfo(string queueType, string queueName); + /// + /// Get all the event handlers + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List<EventHandler> + List GetEventHandlers(); + + /// + /// Get all the event handlers + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of List<EventHandler> + ApiResponse> GetEventHandlersWithHttpInfo(); + /// + /// Get event handlers for a given event + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// List<EventHandler> + List GetEventHandlersForEvent(string _event, bool? activeOnly = null); + + /// + /// Get event handlers for a given event + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// ApiResponse of List<EventHandler> + ApiResponse> GetEventHandlersForEventWithHttpInfo(string _event, bool? activeOnly = null); + /// + /// Get queue config by name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Dictionary<string, Object> + Dictionary GetQueueConfig(string queueType, string queueName); + + /// + /// Get queue config by name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Dictionary<string, Object> + ApiResponse> GetQueueConfigWithHttpInfo(string queueType, string queueName); + /// + /// Get all queue configs + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Dictionary<string, string> + Dictionary GetQueueNames(); + + /// + /// Get all queue configs + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of Dictionary<string, string> + ApiResponse> GetQueueNamesWithHttpInfo(); + /// + /// Create or update queue config by name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + void PutQueueConfig(string body, string queueType, string queueName); + + /// + /// Create or update queue config by name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// ApiResponse of Object(void) + ApiResponse PutQueueConfigWithHttpInfo(string body, string queueType, string queueName); + /// + /// Remove an event handler + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + void RemoveEventHandlerStatus(string name); + + /// + /// Remove an event handler + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + ApiResponse RemoveEventHandlerStatusWithHttpInfo(string name); + /// + /// Update an existing event handler. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + void UpdateEventHandler(EventHandler body); + + /// + /// Update an existing event handler. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + ApiResponse UpdateEventHandlerWithHttpInfo(EventHandler body); + #endregion Synchronous Operations + } +} \ No newline at end of file diff --git a/Conductor/Api/IGroupResourceApi.cs b/Conductor/Api/IGroupResourceApi.cs new file mode 100644 index 00000000..5d606b08 --- /dev/null +++ b/Conductor/Api/IGroupResourceApi.cs @@ -0,0 +1,234 @@ +using System; +using System.Collections.Generic; +using Conductor.Client; +using Conductor.Client.Models; + +namespace Conductor.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IGroupResourceApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Add user to group + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object AddUserToGroup(string groupId, string userId); + + /// + /// Add user to group + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse AddUserToGroupWithHttpInfo(string groupId, string userId); + /// + /// Add users to group + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void AddUsersToGroup(List body, string groupId); + + /// + /// Add users to group + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse AddUsersToGroupWithHttpInfo(List body, string groupId); + /// + /// Delete a group + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Response + Response DeleteGroup(string id); + + /// + /// Delete a group + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Response + ApiResponse DeleteGroupWithHttpInfo(string id); + /// + /// Get the permissions this group has over workflows and tasks + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object GetGrantedPermissions(string groupId); + + /// + /// Get the permissions this group has over workflows and tasks + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse GetGrantedPermissionsWithHttpInfo(string groupId); + /// + /// Get a group by id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object GetGroup(string id); + + /// + /// Get a group by id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse GetGroupWithHttpInfo(string id); + /// + /// Get all users in group + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object GetUsersInGroup(string id); + + /// + /// Get all users in group + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse GetUsersInGroupWithHttpInfo(string id); + /// + /// Get all groups + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List<Group> + List ListGroups(); + + /// + /// Get all groups + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of List<Group> + ApiResponse> ListGroupsWithHttpInfo(); + /// + /// Remove user from group + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object RemoveUserFromGroup(string groupId, string userId); + + /// + /// Remove user from group + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse RemoveUserFromGroupWithHttpInfo(string groupId, string userId); + /// + /// Remove users from group + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void RemoveUsersFromGroup(List body, string groupId); + + /// + /// Remove users from group + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse RemoveUsersFromGroupWithHttpInfo(List body, string groupId); + /// + /// Create or update a group + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object UpsertGroup(UpsertGroupRequest body, string id); + + /// + /// Create or update a group + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse UpsertGroupWithHttpInfo(UpsertGroupRequest body, string id); + #endregion Synchronous Operations + } +} \ No newline at end of file diff --git a/Conductor/Api/IMetadataResourceApi.cs b/Conductor/Api/IMetadataResourceApi.cs new file mode 100644 index 00000000..21ef2255 --- /dev/null +++ b/Conductor/Api/IMetadataResourceApi.cs @@ -0,0 +1,271 @@ +using System; +using System.Collections.Generic; +using Conductor.Client; +using Conductor.Client.Models; + +namespace Conductor.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IMetadataResourceApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Create a new workflow definition + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to false) + /// Object + Object Create(WorkflowDef body, bool? overwrite = null); + + /// + /// Create a new workflow definition + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to false) + /// ApiResponse of Object + ApiResponse CreateWithHttpInfo(WorkflowDef body, bool? overwrite = null); + /// + /// Retrieves workflow definition along with blueprint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional, default to false) + /// WorkflowDef + WorkflowDef Get(string name, int? version = null, bool? metadata = null); + + /// + /// Retrieves workflow definition along with blueprint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional, default to false) + /// ApiResponse of WorkflowDef + ApiResponse GetWithHttpInfo(string name, int? version = null, bool? metadata = null); + /// + /// Retrieves all workflow definition along with blueprint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional, default to READ) + /// (optional, default to false) + /// (optional) + /// (optional) + /// (optional, default to false) + /// List<WorkflowDef> + List GetAllWorkflows(string access = null, bool? metadata = null, string tagKey = null, string tagValue = null, bool? _short = null); + + /// + /// Retrieves all workflow definition along with blueprint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional, default to READ) + /// (optional, default to false) + /// (optional) + /// (optional) + /// (optional, default to false) + /// ApiResponse of List<WorkflowDef> + ApiResponse> GetAllWorkflowsWithHttpInfo(string access = null, bool? metadata = null, string tagKey = null, string tagValue = null, bool? _short = null); + /// + /// Gets the task definition + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to false) + /// Object + TaskDef GetTaskDef(string tasktype, bool? metadata = null); + + /// + /// Gets the task definition + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to false) + /// ApiResponse of Object + ApiResponse GetTaskDefWithHttpInfo(string tasktype, bool? metadata = null); + /// + /// Gets all task definition + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional, default to READ) + /// (optional, default to false) + /// (optional) + /// (optional) + /// List<TaskDef> + List GetTaskDefs(string access = null, bool? metadata = null, string tagKey = null, string tagValue = null); + + /// + /// Gets all task definition + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional, default to READ) + /// (optional, default to false) + /// (optional) + /// (optional) + /// ApiResponse of List<TaskDef> + ApiResponse> GetTaskDefsWithHttpInfo(string access = null, bool? metadata = null, string tagKey = null, string tagValue = null); + /// + /// Create or update task definition(s) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object RegisterTaskDef(List body); + + /// + /// Create or update task definition(s) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse RegisterTaskDefWithHttpInfo(List body); + /// + /// Remove a task definition + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + void UnregisterTaskDef(string tasktype); + + /// + /// Remove a task definition + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + ApiResponse UnregisterTaskDefWithHttpInfo(string tasktype); + /// + /// Removes workflow definition. It does not remove workflows associated with the definition. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void UnregisterWorkflowDef(string name, int? version); + + /// + /// Removes workflow definition. It does not remove workflows associated with the definition. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse UnregisterWorkflowDefWithHttpInfo(string name, int? version); + /// + /// Create or update workflow definition(s) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// Object + Object UpdateWorkflowDefinitions(List body, bool? overwrite = null); + + /// + /// Create or update workflow definition(s) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// ApiResponse of Object + ApiResponse UpdateWithHttpInfo(List body, bool? overwrite = null); + /// + /// Update an existing task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object UpdateTaskDef(TaskDef body); + + /// + /// Update an existing task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse UpdateTaskDefWithHttpInfo(TaskDef body); + /// + /// Upload all workflows and tasks definitions to S3 + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Object + Object UploadWorkflowsAndTasksDefinitionsToS3(); + + /// + /// Upload all workflows and tasks definitions to S3 + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of Object + ApiResponse UploadWorkflowsAndTasksDefinitionsToS3WithHttpInfo(); + #endregion Synchronous Operations + } +} \ No newline at end of file diff --git a/Conductor/Api/ISchedulerResourceApi.cs b/Conductor/Api/ISchedulerResourceApi.cs new file mode 100644 index 00000000..e1aef492 --- /dev/null +++ b/Conductor/Api/ISchedulerResourceApi.cs @@ -0,0 +1,341 @@ +using System; +using System.Collections.Generic; +using Conductor.Client; +using Conductor.Client.Models; + +namespace Conductor.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ISchedulerResourceApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Deletes an existing workflow schedule by name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object DeleteSchedule(string name); + + /// + /// Deletes an existing workflow schedule by name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse DeleteScheduleWithHttpInfo(string name); + /// + /// Delete a tag for schedule + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void DeleteTagForSchedule(List body, string name); + + /// + /// Delete a tag for schedule + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse DeleteTagForScheduleWithHttpInfo(List body, string name); + /// + /// Get all existing workflow schedules and optionally filter by workflow name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional) + /// List<WorkflowSchedule> + List GetAllSchedules(string workflowName = null); + + /// + /// Get all existing workflow schedules and optionally filter by workflow name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional) + /// ApiResponse of List<WorkflowSchedule> + ApiResponse> GetAllSchedulesWithHttpInfo(string workflowName = null); + /// + /// Get list of the next x (default 3, max 5) execution times for a scheduler + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// (optional, default to 3) + /// List<long?> + List GetNextFewSchedules(string cronExpression, long? scheduleStartTime = null, long? scheduleEndTime = null, int? limit = null); + + /// + /// Get list of the next x (default 3, max 5) execution times for a scheduler + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// (optional, default to 3) + /// ApiResponse of List<long?> + ApiResponse> GetNextFewSchedulesWithHttpInfo(string cronExpression, long? scheduleStartTime = null, long? scheduleEndTime = null, int? limit = null); + /// + /// Get an existing workflow schedule by name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// WorkflowSchedule + WorkflowSchedule GetSchedule(string name); + + /// + /// Get an existing workflow schedule by name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of WorkflowSchedule + ApiResponse GetScheduleWithHttpInfo(string name); + /// + /// Get tags by schedule + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// List<TagObject> + List GetTagsForSchedule(string name); + + /// + /// Get tags by schedule + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<TagObject> + ApiResponse> GetTagsForScheduleWithHttpInfo(string name); + /// + /// Pause all scheduling in a single conductor server instance (for debugging only) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Dictionary<string, Object> + Dictionary PauseAllSchedules(); + + /// + /// Pause all scheduling in a single conductor server instance (for debugging only) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of Dictionary<string, Object> + ApiResponse> PauseAllSchedulesWithHttpInfo(); + /// + /// Pauses an existing schedule by name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object PauseSchedule(string name); + + /// + /// Pauses an existing schedule by name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse PauseScheduleWithHttpInfo(string name); + /// + /// Put a tag to schedule + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void PutTagForSchedule(List body, string name); + + /// + /// Put a tag to schedule + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse PutTagForScheduleWithHttpInfo(List body, string name); + /// + /// Requeue all execution records + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Dictionary<string, Object> + Dictionary RequeueAllExecutionRecords(); + + /// + /// Requeue all execution records + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of Dictionary<string, Object> + ApiResponse> RequeueAllExecutionRecordsWithHttpInfo(); + /// + /// Resume all scheduling + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Dictionary<string, Object> + Dictionary ResumeAllSchedules(); + + /// + /// Resume all scheduling + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of Dictionary<string, Object> + ApiResponse> ResumeAllSchedulesWithHttpInfo(); + /// + /// Resume a paused schedule by name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object ResumeSchedule(string name); + + /// + /// Resume a paused schedule by name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse ResumeScheduleWithHttpInfo(string name); + /// + /// Create or update a schedule for a specified workflow with a corresponding start workflow request + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object SaveSchedule(SaveScheduleRequest body); + + /// + /// Create or update a schedule for a specified workflow with a corresponding start workflow request + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse SaveScheduleWithHttpInfo(SaveScheduleRequest body); + /// + /// Search for workflows based on payload and other parameters + /// + /// + /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. + /// + /// Thrown when fails to make API call + /// (optional, default to 0) + /// (optional, default to 100) + /// (optional) + /// (optional, default to *) + /// (optional) + /// SearchResultWorkflowScheduleExecutionModel + SearchResultWorkflowScheduleExecutionModel SearchV22(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); + + /// + /// Search for workflows based on payload and other parameters + /// + /// + /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. + /// + /// Thrown when fails to make API call + /// (optional, default to 0) + /// (optional, default to 100) + /// (optional) + /// (optional, default to *) + /// (optional) + /// ApiResponse of SearchResultWorkflowScheduleExecutionModel + ApiResponse SearchV22WithHttpInfo(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); + /// + /// Test timeout - do not use in production + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + void TestTimeout(); + + /// + /// Test timeout - do not use in production + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of Object(void) + ApiResponse TestTimeoutWithHttpInfo(); + #endregion Synchronous Operations + } +} \ No newline at end of file diff --git a/Conductor/Api/ISecretResourceApi.cs b/Conductor/Api/ISecretResourceApi.cs new file mode 100644 index 00000000..675c5253 --- /dev/null +++ b/Conductor/Api/ISecretResourceApi.cs @@ -0,0 +1,226 @@ +using System; +using System.Collections.Generic; +using Conductor.Client; +using Conductor.Client.Models; + +namespace Conductor.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ISecretResourceApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Delete a secret value by key + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object DeleteSecret(string key); + + /// + /// Delete a secret value by key + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse DeleteSecretWithHttpInfo(string key); + /// + /// Delete tags of the secret + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void DeleteTagForSecret(List body, string key); + + /// + /// Delete tags of the secret + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse DeleteTagForSecretWithHttpInfo(List body, string key); + /// + /// Get secret value by key + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object GetSecret(string key); + + /// + /// Get secret value by key + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse GetSecretWithHttpInfo(string key); + /// + /// Get tags by secret + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// List<TagObject> + List GetTags(string key); + + /// + /// Get tags by secret + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<TagObject> + ApiResponse> GetTagsWithHttpInfo(string key); + /// + /// List all secret names + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Object + Object ListAllSecretNames(); + + /// + /// List all secret names + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of Object + ApiResponse ListAllSecretNamesWithHttpInfo(); + /// + /// List all secret names user can grant access to + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List<string> + List ListSecretsThatUserCanGrantAccessTo(); + + /// + /// List all secret names user can grant access to + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of List<string> + ApiResponse> ListSecretsThatUserCanGrantAccessToWithHttpInfo(); + /// + /// List all secret names along with tags user can grant access to + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List<ExtendedSecret> + List ListSecretsWithTagsThatUserCanGrantAccessTo(); + + /// + /// List all secret names along with tags user can grant access to + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of List<ExtendedSecret> + ApiResponse> ListSecretsWithTagsThatUserCanGrantAccessToWithHttpInfo(); + /// + /// Put a secret value by key + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object PutSecret(string body, string key); + + /// + /// Put a secret value by key + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse PutSecretWithHttpInfo(string body, string key); + /// + /// Tag a secret + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void PutTagForSecret(List body, string key); + + /// + /// Tag a secret + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse PutTagForSecretWithHttpInfo(List body, string key); + /// + /// Check if secret exists + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Object + Object SecretExists(string key); + + /// + /// Check if secret exists + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse SecretExistsWithHttpInfo(string key); + #endregion Synchronous Operations + } +} \ No newline at end of file diff --git a/Conductor/Api/ITagsApi.cs b/Conductor/Api/ITagsApi.cs new file mode 100644 index 00000000..7cc3489e --- /dev/null +++ b/Conductor/Api/ITagsApi.cs @@ -0,0 +1,215 @@ +using System; +using System.Collections.Generic; +using Conductor.Client; +using Conductor.Client.Models; + +namespace Conductor.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ITagsApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Adds the tag to the task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object AddTaskTag(TagObject body, string taskName); + + /// + /// Adds the tag to the task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse AddTaskTagWithHttpInfo(TagObject body, string taskName); + /// + /// Adds the tag to the workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object AddWorkflowTag(TagObject body, string name); + + /// + /// Adds the tag to the workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse AddWorkflowTagWithHttpInfo(TagObject body, string name); + /// + /// Removes the tag of the task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object DeleteTaskTag(TagString body, string taskName); + + /// + /// Removes the tag of the task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse DeleteTaskTagWithHttpInfo(TagString body, string taskName); + /// + /// Removes the tag of the workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object DeleteWorkflowTag(TagObject body, string name); + + /// + /// Removes the tag of the workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse DeleteWorkflowTagWithHttpInfo(TagObject body, string name); + /// + /// List all tags + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List<TagObject> + List GetTags(); + + /// + /// List all tags + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of List<TagObject> + ApiResponse> GetTagsWithHttpInfo(); + /// + /// Returns all the tags of the task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// List<TagObject> + List GetTaskTags(string taskName); + + /// + /// Returns all the tags of the task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<TagObject> + ApiResponse> GetTaskTagsWithHttpInfo(string taskName); + /// + /// Returns all the tags of the workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// List<TagObject> + List GetWorkflowTags(string name); + + /// + /// Returns all the tags of the workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<TagObject> + ApiResponse> GetWorkflowTagsWithHttpInfo(string name); + /// + /// Adds the tag to the task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object SetTaskTags(List body, string taskName); + + /// + /// Adds the tag to the task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse SetTaskTagsWithHttpInfo(List body, string taskName); + /// + /// Set the tags of the workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Object + Object SetWorkflowTags(List body, string name); + + /// + /// Set the tags of the workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object + ApiResponse SetWorkflowTagsWithHttpInfo(List body, string name); + #endregion Synchronous Operations + } +} \ No newline at end of file diff --git a/Conductor/Api/ITaskResourceApi.cs b/Conductor/Api/ITaskResourceApi.cs new file mode 100644 index 00000000..af0b479d --- /dev/null +++ b/Conductor/Api/ITaskResourceApi.cs @@ -0,0 +1,431 @@ +using System; +using System.Collections.Generic; +using Conductor.Client; +using Conductor.Client.Models; + +namespace Conductor.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ITaskResourceApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Get the details about each queue + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Dictionary<string, long?> + Dictionary All(); + + /// + /// Get the details about each queue + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of Dictionary<string, long?> + ApiResponse> AllWithHttpInfo(); + /// + /// Get the details about each queue + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Dictionary<string, Dictionary<string, Dictionary<string, long?>>> + Dictionary>> AllVerbose(); + + /// + /// Get the details about each queue + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of Dictionary<string, Dictionary<string, Dictionary<string, long?>>> + ApiResponse>>> AllVerboseWithHttpInfo(); + /// + /// Batch poll for a task of a certain type + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// (optional, default to 1) + /// (optional, default to 100) + /// List<Task> + List BatchPoll(string tasktype, string workerid = null, string domain = null, int? count = null, int? timeout = null); + + /// + /// Batch poll for a task of a certain type + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// (optional, default to 1) + /// (optional, default to 100) + /// ApiResponse of List<Task> + ApiResponse> BatchPollWithHttpInfo(string tasktype, string workerid = null, string domain = null, int? count = null, int? timeout = null); + /// + /// Get the last poll data for all task types + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// (optional) + /// (optional) + /// (optional) + /// (optional) + /// Dictionary<string, Object> + Dictionary GetAllPollData(long? workerSize = null, string workerOpt = null, long? queueSize = null, string queueOpt = null, long? lastPollTimeSize = null, string lastPollTimeOpt = null); + + /// + /// Get the last poll data for all task types + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional) + /// (optional) + /// (optional) + /// (optional) + /// (optional) + /// (optional) + /// ApiResponse of Dictionary<string, Object> + ApiResponse> GetAllPollDataWithHttpInfo(long? workerSize = null, string workerOpt = null, long? queueSize = null, string queueOpt = null, long? lastPollTimeSize = null, string lastPollTimeOpt = null); + /// + /// Get the external uri where the task payload is to be stored + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// ExternalStorageLocation + ExternalStorageLocation GetExternalStorageLocation(string path, string operation, string payloadType); + + /// + /// Get the external uri where the task payload is to be stored + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// ApiResponse of ExternalStorageLocation + ApiResponse GetExternalStorageLocationWithHttpInfo(string path, string operation, string payloadType); + /// + /// Get the last poll data for a given task type + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// List<PollData> + List GetPollData(string taskType); + + /// + /// Get the last poll data for a given task type + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<PollData> + ApiResponse> GetPollDataWithHttpInfo(string taskType); + /// + /// Get task by Id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Task + Task GetTask(string taskId); + + /// + /// Get task by Id + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Task + ApiResponse GetTaskWithHttpInfo(string taskId); + /// + /// Get Task Execution Logs + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// List<TaskExecLog> + List GetTaskLogs(string taskId); + + /// + /// Get Task Execution Logs + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<TaskExecLog> + ApiResponse> GetTaskLogsWithHttpInfo(string taskId); + /// + /// Log Task Execution Details + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void Log(string body, string taskId); + + /// + /// Log Task Execution Details + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse LogWithHttpInfo(string body, string taskId); + /// + /// Poll for a task of a certain type + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// Task + Task Poll(string tasktype, string workerid = null, string domain = null); + + /// + /// Poll for a task of a certain type + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional) + /// ApiResponse of Task + ApiResponse PollWithHttpInfo(string tasktype, string workerid = null, string domain = null); + /// + /// Requeue pending tasks + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// string + string RequeuePendingTask(string taskType); + + /// + /// Requeue pending tasks + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of string + ApiResponse RequeuePendingTaskWithHttpInfo(string taskType); + /// + /// Search for tasks based in payload and other parameters + /// + /// + /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC + /// + /// Thrown when fails to make API call + /// (optional, default to 0) + /// (optional, default to 100) + /// (optional) + /// (optional, default to *) + /// (optional) + /// SearchResultTaskSummary + SearchResultTaskSummary Search(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); + + /// + /// Search for tasks based in payload and other parameters + /// + /// + /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC + /// + /// Thrown when fails to make API call + /// (optional, default to 0) + /// (optional, default to 100) + /// (optional) + /// (optional, default to *) + /// (optional) + /// ApiResponse of SearchResultTaskSummary + ApiResponse SearchWithHttpInfo(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); + /// + /// Search for tasks based in payload and other parameters + /// + /// + /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC + /// + /// Thrown when fails to make API call + /// (optional, default to 0) + /// (optional, default to 100) + /// (optional) + /// (optional, default to *) + /// (optional) + /// SearchResultTask + SearchResultTask SearchV2(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); + + /// + /// Search for tasks based in payload and other parameters + /// + /// + /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC + /// + /// Thrown when fails to make API call + /// (optional, default to 0) + /// (optional, default to 100) + /// (optional) + /// (optional, default to *) + /// (optional) + /// ApiResponse of SearchResultTask + ApiResponse SearchV2WithHttpInfo(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); + /// + /// Get Task type queue sizes + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional) + /// Dictionary<string, int?> + Dictionary Size(List taskType = null); + + /// + /// Get Task type queue sizes + /// + /// + /// + /// + /// Thrown when fails to make API call + /// (optional) + /// ApiResponse of Dictionary<string, int?> + ApiResponse> SizeWithHttpInfo(List taskType = null); + /// + /// Update a task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// string + string UpdateTask(TaskResult body); + + /// + /// Update a task + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of string + ApiResponse UpdateTaskWithHttpInfo(TaskResult body); + /// + /// Update a task By Ref Name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// (optional) + /// string + string UpdateTask(Dictionary body, string workflowId, string taskRefName, string status, string workerid = null); + + /// + /// Update a task By Ref Name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// ApiResponse of string + ApiResponse UpdateTaskWithHttpInfo(Dictionary body, string workflowId, string taskRefName, string status, string workerid = null); + + + //aa + /// + /// Update a task By Ref Name, evaluates the workflow and returns the updated workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// (optional) + /// Workflow + Workflow UpdateTaskSync(Dictionary output, string workflowId, string taskRefName, TaskResult.StatusEnum status, string workerid = null); + + /// + /// Update a task By Ref Name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// ApiResponse of Workflow + ApiResponse UpdateTaskSyncWithHttpInfo(Dictionary output, string workflowId, string taskRefName, TaskResult.StatusEnum status, string workerid = null); + //aaa + #endregion Synchronous Operations + } +} \ No newline at end of file diff --git a/Conductor/Api/IWorkflowBulkResourceApi.cs b/Conductor/Api/IWorkflowBulkResourceApi.cs new file mode 100644 index 00000000..b2822a73 --- /dev/null +++ b/Conductor/Api/IWorkflowBulkResourceApi.cs @@ -0,0 +1,126 @@ +using System.Collections.Generic; +using Conductor.Client; +using Conductor.Client.Models; + +namespace Conductor.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IWorkflowBulkResourceApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Pause the list of workflows + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// BulkResponse + BulkResponse PauseWorkflow(List body); + + /// + /// Pause the list of workflows + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of BulkResponse + ApiResponse PauseWorkflowWithHttpInfo(List body); + /// + /// Restart the list of completed workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to false) + /// BulkResponse + BulkResponse Restart(List body, bool? useLatestDefinitions = null); + + /// + /// Restart the list of completed workflow + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional, default to false) + /// ApiResponse of BulkResponse + ApiResponse RestartWithHttpInfo(List body, bool? useLatestDefinitions = null); + /// + /// Resume the list of workflows + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// BulkResponse + BulkResponse ResumeWorkflow(List body); + + /// + /// Resume the list of workflows + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of BulkResponse + ApiResponse ResumeWorkflowWithHttpInfo(List body); + /// + /// Retry the last failed task for each workflow from the list + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// BulkResponse + BulkResponse Retry(List body); + + /// + /// Retry the last failed task for each workflow from the list + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of BulkResponse + ApiResponse RetryWithHttpInfo(List body); + /// + /// Terminate workflows execution + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional, default to false) + /// BulkResponse + BulkResponse Terminate(List body, string reason = null, bool? triggerFailureWorkflow = null); + + /// + /// Terminate workflows execution + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// (optional, default to false) + /// ApiResponse of BulkResponse + ApiResponse TerminateWithHttpInfo(List body, string reason = null, bool? triggerFailureWorkflow = null); + #endregion Synchronous Operations + } +} \ No newline at end of file diff --git a/Conductor/Api/IWorkflowResourceApi.cs b/Conductor/Api/IWorkflowResourceApi.cs index 48b9282f..a398702e 100644 --- a/Conductor/Api/IWorkflowResourceApi.cs +++ b/Conductor/Api/IWorkflowResourceApi.cs @@ -77,7 +77,7 @@ public interface IWorkflowResourceApi : IApiAccessor /// /// /// Workflow Workflow UpdateWorkflowVariables(string workflowId, Dictionary variables); - + /// /// Update the value of the workflow variables for the given workflow id and return api response /// @@ -85,7 +85,7 @@ public interface IWorkflowResourceApi : IApiAccessor /// /// /// Workflow ApiResponse UpdateWorkflowVariablesWithHttpInfo(string workflowId, Dictionary variables); - + /// /// Execute a workflow synchronously /// @@ -692,10 +692,10 @@ public interface IWorkflowResourceApi : IApiAccessor /// (optional) /// (optional, default to 10) /// WorkflowRun - WorkflowRun UpdateWorkflow(string workflowId, WorkflowStateUpdate request, + WorkflowRun UpdateWorkflow(string workflowId, WorkflowStateUpdate request, List waitUntilTaskRefs = null, int? waitForSeconds = null); - - + + /// /// Update a workflow state by updating variables or in progress task Updates the workflow variables, tasks and triggers evaluation. /// @@ -705,7 +705,7 @@ WorkflowRun UpdateWorkflow(string workflowId, WorkflowStateUpdate request, /// (optional) /// (optional, default to 10) /// WorkflowRun - ApiResponse UpdateWorkflowWithHttpInfo(string workflowId, WorkflowStateUpdate request, + ApiResponse UpdateWorkflowWithHttpInfo(string workflowId, WorkflowStateUpdate request, List waitUntilTaskRefs = null, int? waitForSeconds = null); /// @@ -719,8 +719,8 @@ ApiResponse UpdateWorkflowWithHttpInfo(string workflowId, Workflow /// (optional, default to true) /// Workflow Workflow GetWorkflow(string workflowId, bool includeTasks); - - + + /// /// Gets the workflow by workflow id /// diff --git a/Conductor/Api/MetadataResourceApi.cs b/Conductor/Api/MetadataResourceApi.cs index 246a1ea5..cea40d95 100644 --- a/Conductor/Api/MetadataResourceApi.cs +++ b/Conductor/Api/MetadataResourceApi.cs @@ -1,435 +1,160 @@ using System; using System.Collections.Generic; using System.Linq; -using RestSharp; using Conductor.Client; using Conductor.Client.Models; +using RestSharp; namespace Conductor.Api { /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IMetadataResourceApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Create a new workflow definition - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to false) - /// Object - Object Create(WorkflowDef body, bool? overwrite = null); - - /// - /// Create a new workflow definition - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to false) - /// ApiResponse of Object - ApiResponse CreateWithHttpInfo(WorkflowDef body, bool? overwrite = null); - /// - /// Retrieves workflow definition along with blueprint - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional) - /// (optional, default to false) - /// WorkflowDef - WorkflowDef Get(string name, int? version = null, bool? metadata = null); - - /// - /// Retrieves workflow definition along with blueprint - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional) - /// (optional, default to false) - /// ApiResponse of WorkflowDef - ApiResponse GetWithHttpInfo(string name, int? version = null, bool? metadata = null); - /// - /// Retrieves all workflow definition along with blueprint - /// - /// - /// - /// - /// Thrown when fails to make API call - /// (optional, default to READ) - /// (optional, default to false) - /// (optional) - /// (optional) - /// (optional, default to false) - /// List<WorkflowDef> - List GetAllWorkflows(string access = null, bool? metadata = null, string tagKey = null, string tagValue = null, bool? _short = null); - - /// - /// Retrieves all workflow definition along with blueprint - /// - /// - /// - /// - /// Thrown when fails to make API call - /// (optional, default to READ) - /// (optional, default to false) - /// (optional) - /// (optional) - /// (optional, default to false) - /// ApiResponse of List<WorkflowDef> - ApiResponse> GetAllWorkflowsWithHttpInfo(string access = null, bool? metadata = null, string tagKey = null, string tagValue = null, bool? _short = null); - /// - /// Gets the task definition - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to false) - /// Object - TaskDef GetTaskDef(string tasktype, bool? metadata = null); - - /// - /// Gets the task definition - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to false) - /// ApiResponse of Object - ApiResponse GetTaskDefWithHttpInfo(string tasktype, bool? metadata = null); - /// - /// Gets all task definition - /// - /// - /// - /// - /// Thrown when fails to make API call - /// (optional, default to READ) - /// (optional, default to false) - /// (optional) - /// (optional) - /// List<TaskDef> - List GetTaskDefs(string access = null, bool? metadata = null, string tagKey = null, string tagValue = null); - - /// - /// Gets all task definition - /// - /// - /// - /// - /// Thrown when fails to make API call - /// (optional, default to READ) - /// (optional, default to false) - /// (optional) - /// (optional) - /// ApiResponse of List<TaskDef> - ApiResponse> GetTaskDefsWithHttpInfo(string access = null, bool? metadata = null, string tagKey = null, string tagValue = null); - /// - /// Create or update task definition(s) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object RegisterTaskDef(List body); - - /// - /// Create or update task definition(s) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse RegisterTaskDefWithHttpInfo(List body); - /// - /// Remove a task definition - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - void UnregisterTaskDef(string tasktype); - - /// - /// Remove a task definition - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object(void) - ApiResponse UnregisterTaskDefWithHttpInfo(string tasktype); - /// - /// Removes workflow definition. It does not remove workflows associated with the definition. - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - void UnregisterWorkflowDef(string name, int? version); - - /// - /// Removes workflow definition. It does not remove workflows associated with the definition. - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object(void) - ApiResponse UnregisterWorkflowDefWithHttpInfo(string name, int? version); - /// - /// Create or update workflow definition(s) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to true) - /// Object - Object UpdateWorkflowDefinitions(List body, bool? overwrite = null); - - /// - /// Create or update workflow definition(s) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to true) - /// ApiResponse of Object - ApiResponse UpdateWithHttpInfo(List body, bool? overwrite = null); - /// - /// Update an existing task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object UpdateTaskDef(TaskDef body); - - /// - /// Update an existing task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse UpdateTaskDefWithHttpInfo(TaskDef body); - /// - /// Upload all workflows and tasks definitions to S3 - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Object - Object UploadWorkflowsAndTasksDefinitionsToS3(); - - /// - /// Upload all workflows and tasks definitions to S3 - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of Object - ApiResponse UploadWorkflowsAndTasksDefinitionsToS3WithHttpInfo(); - #endregion Synchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public partial class MetadataResourceApi : IMetadataResourceApi + public class MetadataResourceApi : IMetadataResourceApi { - private Conductor.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + private ExceptionFactory _exceptionFactory = (name, response) => null; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - public MetadataResourceApi(String basePath) + public MetadataResourceApi(string basePath) { - this.Configuration = new Conductor.Client.Configuration { BasePath = basePath }; + Configuration = new Configuration { BasePath = basePath }; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// /// public MetadataResourceApi() { - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class - /// using Configuration object + /// Initializes a new instance of the class + /// using Configuration object /// /// An instance of Configuration /// - public MetadataResourceApi(Conductor.Client.Configuration configuration = null) + public MetadataResourceApi(Configuration configuration = null) { if (configuration == null) // use the default one in Configuration - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; else - this.Configuration = configuration; + Configuration = configuration; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Gets or sets the configuration object + /// Gets or sets the configuration object /// /// An instance of the Configuration - public Conductor.Client.Configuration Configuration { get; set; } + public Configuration Configuration { get; set; } /// - /// Provides a factory method hook for the creation of exceptions. + /// Provides a factory method hook for the creation of exceptions. /// - public Conductor.Client.ExceptionFactory ExceptionFactory + public ExceptionFactory ExceptionFactory { get { if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } return _exceptionFactory; } - set { _exceptionFactory = value; } + set => _exceptionFactory = value; } /// - /// Create a new workflow definition + /// Create a new workflow definition /// /// Thrown when fails to make API call /// /// (optional, default to false) /// Object - public Object Create(WorkflowDef body, bool? overwrite = null) + public object Create(WorkflowDef body, bool? overwrite = null) { - ApiResponse localVarResponse = CreateWithHttpInfo(body, overwrite); + var localVarResponse = CreateWithHttpInfo(body, overwrite); return localVarResponse.Data; } /// - /// Create a new workflow definition + /// Create a new workflow definition /// /// Thrown when fails to make API call /// /// (optional, default to false) /// ApiResponse of Object - public ApiResponse CreateWithHttpInfo(WorkflowDef body, bool? overwrite = null) + public ApiResponse CreateWithHttpInfo(WorkflowDef body, bool? overwrite = null) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling MetadataResourceApi->Create"); + throw new ApiException(400, + "Missing required parameter 'body' when calling MetadataResourceApi->Create"); var localVarPath = "/metadata/workflow"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (overwrite != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "overwrite", overwrite)); // query parameter + if (overwrite != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "overwrite", overwrite)); // query parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("Create", localVarResponse); + var exception = ExceptionFactory("Create", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Retrieves workflow definition along with blueprint + /// Retrieves workflow definition along with blueprint /// /// Thrown when fails to make API call /// @@ -438,12 +163,12 @@ public ApiResponse CreateWithHttpInfo(WorkflowDef body, bool? overwrite /// WorkflowDef public WorkflowDef Get(string name, int? version = null, bool? metadata = null) { - ApiResponse localVarResponse = GetWithHttpInfo(name, version, metadata); + var localVarResponse = GetWithHttpInfo(name, version, metadata); return localVarResponse.Data; } /// - /// Retrieves workflow definition along with blueprint + /// Retrieves workflow definition along with blueprint /// /// Thrown when fails to make API call /// @@ -457,55 +182,61 @@ public ApiResponse GetWithHttpInfo(string name, int? version = null throw new ApiException(400, "Missing required parameter 'name' when calling MetadataResourceApi->Get"); var localVarPath = "/metadata/workflow/{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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 (version != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "version", version)); // query parameter - if (metadata != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "metadata", metadata)); // query parameter - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (name != null) + localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter + if (version != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "version", version)); // query parameter + if (metadata != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "metadata", metadata)); // query parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("Get", localVarResponse); + var exception = ExceptionFactory("Get", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (WorkflowDef)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(WorkflowDef))); + (WorkflowDef)Configuration.ApiClient.Deserialize(localVarResponse, typeof(WorkflowDef))); } /// - /// Retrieves all workflow definition along with blueprint + /// Retrieves all workflow definition along with blueprint /// /// Thrown when fails to make API call /// (optional, default to READ) @@ -514,14 +245,15 @@ public ApiResponse GetWithHttpInfo(string name, int? version = null /// (optional) /// (optional, default to false) /// List<WorkflowDef> - public List GetAllWorkflows(string access = null, bool? metadata = null, string tagKey = null, string tagValue = null, bool? _short = null) + public List GetAllWorkflows(string access = null, bool? metadata = null, string tagKey = null, + string tagValue = null, bool? _short = null) { - ApiResponse> localVarResponse = GetAllWorkflowsWithHttpInfo(access, metadata, tagKey, tagValue, _short); + var localVarResponse = GetAllWorkflowsWithHttpInfo(access, metadata, tagKey, tagValue, _short); return localVarResponse.Data; } /// - /// Retrieves all workflow definition along with blueprint + /// Retrieves all workflow definition along with blueprint /// /// Thrown when fails to make API call /// (optional, default to READ) @@ -530,61 +262,72 @@ public List GetAllWorkflows(string access = null, bool? metadata = /// (optional) /// (optional, default to false) /// ApiResponse of List<WorkflowDef> - public ApiResponse> GetAllWorkflowsWithHttpInfo(string access = null, bool? metadata = null, string tagKey = null, string tagValue = null, bool? _short = null) + public ApiResponse> GetAllWorkflowsWithHttpInfo(string access = null, bool? metadata = null, + string tagKey = null, string tagValue = null, bool? _short = null) { - var localVarPath = "/metadata/workflow"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (access != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "access", access)); // query parameter - if (metadata != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "metadata", metadata)); // query parameter - if (tagKey != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tagKey", tagKey)); // query parameter - if (tagValue != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tagValue", tagValue)); // query parameter - if (_short != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "short", _short)); // query parameter - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (access != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "access", access)); // query parameter + if (metadata != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "metadata", metadata)); // query parameter + if (tagKey != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "tagKey", tagKey)); // query parameter + if (tagValue != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "tagValue", tagValue)); // query parameter + if (_short != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "short", _short)); // query parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetAllWorkflows", localVarResponse); + var exception = ExceptionFactory("GetAllWorkflows", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// - /// Gets the task definition + /// Gets the task definition /// /// Thrown when fails to make API call /// @@ -592,12 +335,12 @@ public ApiResponse> GetAllWorkflowsWithHttpInfo(string access /// Object public TaskDef GetTaskDef(string tasktype, bool? metadata = null) { - ApiResponse localVarResponse = GetTaskDefWithHttpInfo(tasktype, metadata); + var localVarResponse = GetTaskDefWithHttpInfo(tasktype, metadata); return localVarResponse.Data; } /// - /// Gets the task definition + /// Gets the task definition /// /// Thrown when fails to make API call /// @@ -607,57 +350,63 @@ public ApiResponse GetTaskDefWithHttpInfo(string tasktype, bool? metada { // verify the required parameter 'tasktype' is set if (tasktype == null) - throw new ApiException(400, "Missing required parameter 'tasktype' when calling MetadataResourceApi->GetTaskDef"); + throw new ApiException(400, + "Missing required parameter 'tasktype' when calling MetadataResourceApi->GetTaskDef"); var localVarPath = "/metadata/taskdefs/{tasktype}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (tasktype != null) localVarPathParams.Add("tasktype", this.Configuration.ApiClient.ParameterToString(tasktype)); // path parameter - if (metadata != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "metadata", metadata)); // query parameter - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (tasktype != null) + localVarPathParams.Add("tasktype", + Configuration.ApiClient.ParameterToString(tasktype)); // path parameter + if (metadata != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "metadata", metadata)); // query parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetTaskDef", localVarResponse); + var exception = ExceptionFactory("GetTaskDef", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (TaskDef)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TaskDef))); + (TaskDef)Configuration.ApiClient.Deserialize(localVarResponse, typeof(TaskDef))); } /// - /// Gets all task definition + /// Gets all task definition /// /// Thrown when fails to make API call /// (optional, default to READ) @@ -665,14 +414,15 @@ public ApiResponse GetTaskDefWithHttpInfo(string tasktype, bool? metada /// (optional) /// (optional) /// List<TaskDef> - public List GetTaskDefs(string access = null, bool? metadata = null, string tagKey = null, string tagValue = null) + public List GetTaskDefs(string access = null, bool? metadata = null, string tagKey = null, + string tagValue = null) { - ApiResponse> localVarResponse = GetTaskDefsWithHttpInfo(access, metadata, tagKey, tagValue); + var localVarResponse = GetTaskDefsWithHttpInfo(access, metadata, tagKey, tagValue); return localVarResponse.Data; } /// - /// Gets all task definition + /// Gets all task definition /// /// Thrown when fails to make API call /// (optional, default to READ) @@ -680,138 +430,145 @@ public List GetTaskDefs(string access = null, bool? metadata = null, st /// (optional) /// (optional) /// ApiResponse of List<TaskDef> - public ApiResponse> GetTaskDefsWithHttpInfo(string access = null, bool? metadata = null, string tagKey = null, string tagValue = null) + public ApiResponse> GetTaskDefsWithHttpInfo(string access = null, bool? metadata = null, + string tagKey = null, string tagValue = null) { - var localVarPath = "/metadata/taskdefs"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (access != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "access", access)); // query parameter - if (metadata != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "metadata", metadata)); // query parameter - if (tagKey != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tagKey", tagKey)); // query parameter - if (tagValue != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "tagValue", tagValue)); // query parameter - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (access != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "access", access)); // query parameter + if (metadata != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "metadata", metadata)); // query parameter + if (tagKey != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "tagKey", tagKey)); // query parameter + if (tagValue != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "tagValue", tagValue)); // query parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetTaskDefs", localVarResponse); + var exception = ExceptionFactory("GetTaskDefs", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// - /// Create or update task definition(s) + /// Create or update task definition(s) /// /// Thrown when fails to make API call /// /// Object - public Object RegisterTaskDef(List body) + public object RegisterTaskDef(List body) { - ApiResponse localVarResponse = RegisterTaskDefWithHttpInfo(body); + var localVarResponse = RegisterTaskDefWithHttpInfo(body); return localVarResponse.Data; } /// - /// Create or update task definition(s) + /// Create or update task definition(s) /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse RegisterTaskDefWithHttpInfo(List body) + public ApiResponse RegisterTaskDefWithHttpInfo(List body) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling MetadataResourceApi->RegisterTaskDef"); + throw new ApiException(400, + "Missing required parameter 'body' when calling MetadataResourceApi->RegisterTaskDef"); var localVarPath = "/metadata/taskdefs"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("RegisterTaskDef", localVarResponse); + var exception = ExceptionFactory("RegisterTaskDef", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Remove a task definition + /// Remove a task definition /// /// Thrown when fails to make API call /// @@ -822,64 +579,68 @@ public void UnregisterTaskDef(string tasktype) } /// - /// Remove a task definition + /// Remove a task definition /// /// Thrown when fails to make API call /// /// ApiResponse of Object(void) - public ApiResponse UnregisterTaskDefWithHttpInfo(string tasktype) + public ApiResponse UnregisterTaskDefWithHttpInfo(string tasktype) { // verify the required parameter 'tasktype' is set if (tasktype == null) - throw new ApiException(400, "Missing required parameter 'tasktype' when calling MetadataResourceApi->UnregisterTaskDef"); + throw new ApiException(400, + "Missing required parameter 'tasktype' when calling MetadataResourceApi->UnregisterTaskDef"); var localVarPath = "/metadata/taskdefs/{tasktype}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (tasktype != null) localVarPathParams.Add("tasktype", this.Configuration.ApiClient.ParameterToString(tasktype)); // path parameter - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (tasktype != null) + localVarPathParams.Add("tasktype", + Configuration.ApiClient.ParameterToString(tasktype)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("UnregisterTaskDef", localVarResponse); + var exception = ExceptionFactory("UnregisterTaskDef", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// - /// Removes workflow definition. It does not remove workflows associated with the definition. + /// Removes workflow definition. It does not remove workflows associated with the definition. /// /// Thrown when fails to make API call /// @@ -891,289 +652,300 @@ public void UnregisterWorkflowDef(string name, int? version) } /// - /// Removes workflow definition. It does not remove workflows associated with the definition. + /// Removes workflow definition. It does not remove workflows associated with the definition. /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object(void) - public ApiResponse UnregisterWorkflowDefWithHttpInfo(string name, int? version) + public ApiResponse UnregisterWorkflowDefWithHttpInfo(string name, int? version) { // verify the required parameter 'name' is set if (name == null) - throw new ApiException(400, "Missing required parameter 'name' when calling MetadataResourceApi->UnregisterWorkflowDef"); + throw new ApiException(400, + "Missing required parameter 'name' when calling MetadataResourceApi->UnregisterWorkflowDef"); // verify the required parameter 'version' is set if (version == null) - throw new ApiException(400, "Missing required parameter 'version' when calling MetadataResourceApi->UnregisterWorkflowDef"); + throw new ApiException(400, + "Missing required parameter 'version' when calling MetadataResourceApi->UnregisterWorkflowDef"); var localVarPath = "/metadata/workflow/{name}/{version}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 (version != null) localVarPathParams.Add("version", this.Configuration.ApiClient.ParameterToString(version)); // path parameter - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (name != null) + localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter + if (version != null) + localVarPathParams.Add("version", Configuration.ApiClient.ParameterToString(version)); // path parameter + // authentication (api_key) required + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("UnregisterWorkflowDef", localVarResponse); + var exception = ExceptionFactory("UnregisterWorkflowDef", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// - /// Create or update workflow definition(s) + /// Create or update workflow definition(s) /// /// Thrown when fails to make API call /// /// (optional, default to true) /// Object - public Object UpdateWorkflowDefinitions(List body, bool? overwrite = null) + public object UpdateWorkflowDefinitions(List body, bool? overwrite = null) { - ApiResponse localVarResponse = UpdateWithHttpInfo(body, overwrite); + var localVarResponse = UpdateWithHttpInfo(body, overwrite); return localVarResponse.Data; } /// - /// Create or update workflow definition(s) + /// Create or update workflow definition(s) /// /// Thrown when fails to make API call /// /// (optional, default to true) /// ApiResponse of Object - public ApiResponse UpdateWithHttpInfo(List body, bool? overwrite = null) + public ApiResponse UpdateWithHttpInfo(List body, bool? overwrite = null) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling MetadataResourceApi->Update"); + throw new ApiException(400, + "Missing required parameter 'body' when calling MetadataResourceApi->Update"); var localVarPath = "/metadata/workflow"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (overwrite != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "overwrite", overwrite)); // query parameter + if (overwrite != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "overwrite", overwrite)); // query parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("Update", localVarResponse); + var exception = ExceptionFactory("Update", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Update an existing task + /// Update an existing task /// /// Thrown when fails to make API call /// /// Object - public Object UpdateTaskDef(TaskDef body) + public object UpdateTaskDef(TaskDef body) { - ApiResponse localVarResponse = UpdateTaskDefWithHttpInfo(body); + var localVarResponse = UpdateTaskDefWithHttpInfo(body); return localVarResponse.Data; } /// - /// Update an existing task + /// Update an existing task /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse UpdateTaskDefWithHttpInfo(TaskDef body) + public ApiResponse UpdateTaskDefWithHttpInfo(TaskDef body) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling MetadataResourceApi->UpdateTaskDef"); + throw new ApiException(400, + "Missing required parameter 'body' when calling MetadataResourceApi->UpdateTaskDef"); var localVarPath = "/metadata/taskdefs"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("UpdateTaskDef", localVarResponse); + var exception = ExceptionFactory("UpdateTaskDef", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Upload all workflows and tasks definitions to S3 + /// Upload all workflows and tasks definitions to S3 /// /// Thrown when fails to make API call /// Object - public Object UploadWorkflowsAndTasksDefinitionsToS3() + public object UploadWorkflowsAndTasksDefinitionsToS3() { - ApiResponse localVarResponse = UploadWorkflowsAndTasksDefinitionsToS3WithHttpInfo(); + var localVarResponse = UploadWorkflowsAndTasksDefinitionsToS3WithHttpInfo(); return localVarResponse.Data; } /// - /// Upload all workflows and tasks definitions to S3 + /// Upload all workflows and tasks definitions to S3 /// /// Thrown when fails to make API call /// ApiResponse of Object - public ApiResponse UploadWorkflowsAndTasksDefinitionsToS3WithHttpInfo() + public ApiResponse UploadWorkflowsAndTasksDefinitionsToS3WithHttpInfo() { - var localVarPath = "/metadata/workflow-task-defs/upload"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("UploadWorkflowsAndTasksDefinitionsToS3", localVarResponse); + var exception = ExceptionFactory("UploadWorkflowsAndTasksDefinitionsToS3", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } } -} +} \ No newline at end of file diff --git a/Conductor/Api/SchedulerResourceApi.cs b/Conductor/Api/SchedulerResourceApi.cs index 2eab8034..b8ea32e3 100644 --- a/Conductor/Api/SchedulerResourceApi.cs +++ b/Conductor/Api/SchedulerResourceApi.cs @@ -1,494 +1,152 @@ using System; using System.Collections.Generic; using System.Linq; -using RestSharp; using Conductor.Client; using Conductor.Client.Models; +using RestSharp; namespace Conductor.Api { /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface ISchedulerResourceApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Deletes an existing workflow schedule by name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object DeleteSchedule(string name); - - /// - /// Deletes an existing workflow schedule by name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse DeleteScheduleWithHttpInfo(string name); - /// - /// Delete a tag for schedule - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - void DeleteTagForSchedule(List body, string name); - - /// - /// Delete a tag for schedule - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object(void) - ApiResponse DeleteTagForScheduleWithHttpInfo(List body, string name); - /// - /// Get all existing workflow schedules and optionally filter by workflow name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// (optional) - /// List<WorkflowSchedule> - List GetAllSchedules(string workflowName = null); - - /// - /// Get all existing workflow schedules and optionally filter by workflow name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// (optional) - /// ApiResponse of List<WorkflowSchedule> - ApiResponse> GetAllSchedulesWithHttpInfo(string workflowName = null); - /// - /// Get list of the next x (default 3, max 5) execution times for a scheduler - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional) - /// (optional) - /// (optional, default to 3) - /// List<long?> - List GetNextFewSchedules(string cronExpression, long? scheduleStartTime = null, long? scheduleEndTime = null, int? limit = null); - - /// - /// Get list of the next x (default 3, max 5) execution times for a scheduler - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional) - /// (optional) - /// (optional, default to 3) - /// ApiResponse of List<long?> - ApiResponse> GetNextFewSchedulesWithHttpInfo(string cronExpression, long? scheduleStartTime = null, long? scheduleEndTime = null, int? limit = null); - /// - /// Get an existing workflow schedule by name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// WorkflowSchedule - WorkflowSchedule GetSchedule(string name); - - /// - /// Get an existing workflow schedule by name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of WorkflowSchedule - ApiResponse GetScheduleWithHttpInfo(string name); - /// - /// Get tags by schedule - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// List<TagObject> - List GetTagsForSchedule(string name); - - /// - /// Get tags by schedule - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of List<TagObject> - ApiResponse> GetTagsForScheduleWithHttpInfo(string name); - /// - /// Pause all scheduling in a single conductor server instance (for debugging only) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Dictionary<string, Object> - Dictionary PauseAllSchedules(); - - /// - /// Pause all scheduling in a single conductor server instance (for debugging only) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, Object> - ApiResponse> PauseAllSchedulesWithHttpInfo(); - /// - /// Pauses an existing schedule by name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object PauseSchedule(string name); - - /// - /// Pauses an existing schedule by name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse PauseScheduleWithHttpInfo(string name); - /// - /// Put a tag to schedule - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - void PutTagForSchedule(List body, string name); - - /// - /// Put a tag to schedule - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object(void) - ApiResponse PutTagForScheduleWithHttpInfo(List body, string name); - /// - /// Requeue all execution records - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Dictionary<string, Object> - Dictionary RequeueAllExecutionRecords(); - - /// - /// Requeue all execution records - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, Object> - ApiResponse> RequeueAllExecutionRecordsWithHttpInfo(); - /// - /// Resume all scheduling - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Dictionary<string, Object> - Dictionary ResumeAllSchedules(); - - /// - /// Resume all scheduling - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, Object> - ApiResponse> ResumeAllSchedulesWithHttpInfo(); - /// - /// Resume a paused schedule by name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object ResumeSchedule(string name); - - /// - /// Resume a paused schedule by name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse ResumeScheduleWithHttpInfo(string name); - /// - /// Create or update a schedule for a specified workflow with a corresponding start workflow request - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object SaveSchedule(SaveScheduleRequest body); - - /// - /// Create or update a schedule for a specified workflow with a corresponding start workflow request - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse SaveScheduleWithHttpInfo(SaveScheduleRequest body); - /// - /// Search for workflows based on payload and other parameters - /// - /// - /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. - /// - /// Thrown when fails to make API call - /// (optional, default to 0) - /// (optional, default to 100) - /// (optional) - /// (optional, default to *) - /// (optional) - /// SearchResultWorkflowScheduleExecutionModel - SearchResultWorkflowScheduleExecutionModel SearchV22(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); - - /// - /// Search for workflows based on payload and other parameters - /// - /// - /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. - /// - /// Thrown when fails to make API call - /// (optional, default to 0) - /// (optional, default to 100) - /// (optional) - /// (optional, default to *) - /// (optional) - /// ApiResponse of SearchResultWorkflowScheduleExecutionModel - ApiResponse SearchV22WithHttpInfo(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); - /// - /// Test timeout - do not use in production - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - void TestTimeout(); - - /// - /// Test timeout - do not use in production - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of Object(void) - ApiResponse TestTimeoutWithHttpInfo(); - #endregion Synchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public partial class SchedulerResourceApi : ISchedulerResourceApi + public class SchedulerResourceApi : ISchedulerResourceApi { - private Conductor.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + private ExceptionFactory _exceptionFactory = (name, response) => null; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - public SchedulerResourceApi(String basePath) + public SchedulerResourceApi(string basePath) { - this.Configuration = new Conductor.Client.Configuration { BasePath = basePath }; + Configuration = new Configuration { BasePath = basePath }; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// /// public SchedulerResourceApi() { - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class - /// using Configuration object + /// Initializes a new instance of the class + /// using Configuration object /// /// An instance of Configuration /// - public SchedulerResourceApi(Conductor.Client.Configuration configuration = null) + public SchedulerResourceApi(Configuration configuration = null) { if (configuration == null) // use the default one in Configuration - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; else - this.Configuration = configuration; - - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; - } + Configuration = configuration; - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Gets or sets the configuration object + /// Gets or sets the configuration object /// /// An instance of the Configuration - public Conductor.Client.Configuration Configuration { get; set; } + public Configuration Configuration { get; set; } /// - /// Provides a factory method hook for the creation of exceptions. + /// Provides a factory method hook for the creation of exceptions. /// - public Conductor.Client.ExceptionFactory ExceptionFactory + public ExceptionFactory ExceptionFactory { get { if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } return _exceptionFactory; } - set { _exceptionFactory = value; } + set => _exceptionFactory = value; } /// - /// Deletes an existing workflow schedule by name + /// Deletes an existing workflow schedule by name /// /// Thrown when fails to make API call /// /// Object - public Object DeleteSchedule(string name) + public object DeleteSchedule(string name) { - ApiResponse localVarResponse = DeleteScheduleWithHttpInfo(name); + var localVarResponse = DeleteScheduleWithHttpInfo(name); return localVarResponse.Data; } /// - /// Deletes an existing workflow schedule by name + /// Deletes an existing workflow schedule by name /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse DeleteScheduleWithHttpInfo(string name) + public ApiResponse DeleteScheduleWithHttpInfo(string name) { // verify the required parameter 'name' is set if (name == null) - throw new ApiException(400, "Missing required parameter 'name' when calling SchedulerResourceApi->DeleteSchedule"); + throw new ApiException(400, + "Missing required parameter 'name' when calling SchedulerResourceApi->DeleteSchedule"); var localVarPath = "/scheduler/schedules/{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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 (name != null) + localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("DeleteSchedule", localVarResponse); + var exception = ExceptionFactory("DeleteSchedule", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Delete a tag for schedule + /// Delete a tag for schedule /// /// Thrown when fails to make API call /// @@ -500,144 +158,148 @@ public void DeleteTagForSchedule(List body, string name) } /// - /// Delete a tag for schedule + /// Delete a tag for schedule /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object(void) - public ApiResponse DeleteTagForScheduleWithHttpInfo(List body, string name) + public ApiResponse DeleteTagForScheduleWithHttpInfo(List body, string name) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling SchedulerResourceApi->DeleteTagForSchedule"); + throw new ApiException(400, + "Missing required parameter 'body' when calling SchedulerResourceApi->DeleteTagForSchedule"); // verify the required parameter 'name' is set if (name == null) - throw new ApiException(400, "Missing required parameter 'name' when calling SchedulerResourceApi->DeleteTagForSchedule"); + throw new ApiException(400, + "Missing required parameter 'name' when calling SchedulerResourceApi->DeleteTagForSchedule"); var localVarPath = "/scheduler/schedules/{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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 (name != null) + localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("DeleteTagForSchedule", localVarResponse); + var exception = ExceptionFactory("DeleteTagForSchedule", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// - /// Get all existing workflow schedules and optionally filter by workflow name + /// Get all existing workflow schedules and optionally filter by workflow name /// /// Thrown when fails to make API call /// (optional) /// List<WorkflowSchedule> public List GetAllSchedules(string workflowName = null) { - ApiResponse> localVarResponse = GetAllSchedulesWithHttpInfo(workflowName); + var localVarResponse = GetAllSchedulesWithHttpInfo(workflowName); return localVarResponse.Data; } /// - /// Get all existing workflow schedules and optionally filter by workflow name + /// Get all existing workflow schedules and optionally filter by workflow name /// /// Thrown when fails to make API call /// (optional) /// ApiResponse of List<WorkflowSchedule> public ApiResponse> GetAllSchedulesWithHttpInfo(string workflowName = null) { - var localVarPath = "/scheduler/schedules"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (workflowName != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "workflowName", workflowName)); // query parameter + if (workflowName != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "workflowName", + workflowName)); // query parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetAllSchedules", localVarResponse); + var exception = ExceptionFactory("GetAllSchedules", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, + typeof(List))); } /// - /// Get list of the next x (default 3, max 5) execution times for a scheduler + /// Get list of the next x (default 3, max 5) execution times for a scheduler /// /// Thrown when fails to make API call /// @@ -645,14 +307,16 @@ public ApiResponse> GetAllSchedulesWithHttpInfo(string wo /// (optional) /// (optional, default to 3) /// List<long?> - public List GetNextFewSchedules(string cronExpression, long? scheduleStartTime = null, long? scheduleEndTime = null, int? limit = null) + public List GetNextFewSchedules(string cronExpression, long? scheduleStartTime = null, + long? scheduleEndTime = null, int? limit = null) { - ApiResponse> localVarResponse = GetNextFewSchedulesWithHttpInfo(cronExpression, scheduleStartTime, scheduleEndTime, limit); + var localVarResponse = + GetNextFewSchedulesWithHttpInfo(cronExpression, scheduleStartTime, scheduleEndTime, limit); return localVarResponse.Data; } /// - /// Get list of the next x (default 3, max 5) execution times for a scheduler + /// Get list of the next x (default 3, max 5) execution times for a scheduler /// /// Thrown when fails to make API call /// @@ -660,75 +324,89 @@ public ApiResponse> GetAllSchedulesWithHttpInfo(string wo /// (optional) /// (optional, default to 3) /// ApiResponse of List<long?> - public ApiResponse> GetNextFewSchedulesWithHttpInfo(string cronExpression, long? scheduleStartTime = null, long? scheduleEndTime = null, int? limit = null) + public ApiResponse> GetNextFewSchedulesWithHttpInfo(string cronExpression, + long? scheduleStartTime = null, long? scheduleEndTime = null, int? limit = null) { // verify the required parameter 'cronExpression' is set if (cronExpression == null) - throw new ApiException(400, "Missing required parameter 'cronExpression' when calling SchedulerResourceApi->GetNextFewSchedules"); + throw new ApiException(400, + "Missing required parameter 'cronExpression' when calling SchedulerResourceApi->GetNextFewSchedules"); var localVarPath = "/scheduler/nextFewSchedules"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (cronExpression != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "cronExpression", cronExpression)); // query parameter - if (scheduleStartTime != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "scheduleStartTime", scheduleStartTime)); // query parameter - if (scheduleEndTime != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "scheduleEndTime", scheduleEndTime)); // query parameter - if (limit != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter + if (cronExpression != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "cronExpression", + cronExpression)); // query parameter + if (scheduleStartTime != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "scheduleStartTime", + scheduleStartTime)); // query parameter + if (scheduleEndTime != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "scheduleEndTime", + scheduleEndTime)); // query parameter + if (limit != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetNextFewSchedules", localVarResponse); + var exception = ExceptionFactory("GetNextFewSchedules", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// - /// Get an existing workflow schedule by name + /// Get an existing workflow schedule by name /// /// Thrown when fails to make API call /// /// WorkflowSchedule public WorkflowSchedule GetSchedule(string name) { - ApiResponse localVarResponse = GetScheduleWithHttpInfo(name); + var localVarResponse = GetScheduleWithHttpInfo(name); return localVarResponse.Data; } /// - /// Get an existing workflow schedule by name + /// Get an existing workflow schedule by name /// /// Thrown when fails to make API call /// @@ -737,68 +415,71 @@ public ApiResponse GetScheduleWithHttpInfo(string name) { // verify the required parameter 'name' is set if (name == null) - throw new ApiException(400, "Missing required parameter 'name' when calling SchedulerResourceApi->GetSchedule"); + throw new ApiException(400, + "Missing required parameter 'name' when calling SchedulerResourceApi->GetSchedule"); var localVarPath = "/scheduler/schedules/{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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 (name != null) + localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetSchedule", localVarResponse); + var exception = ExceptionFactory("GetSchedule", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (WorkflowSchedule)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(WorkflowSchedule))); + (WorkflowSchedule)Configuration.ApiClient.Deserialize(localVarResponse, typeof(WorkflowSchedule))); } /// - /// Get tags by schedule + /// Get tags by schedule /// /// Thrown when fails to make API call /// /// List<TagObject> public List GetTagsForSchedule(string name) { - ApiResponse> localVarResponse = GetTagsForScheduleWithHttpInfo(name); + var localVarResponse = GetTagsForScheduleWithHttpInfo(name); return localVarResponse.Data; } /// - /// Get tags by schedule + /// Get tags by schedule /// /// Thrown when fails to make API call /// @@ -807,190 +488,197 @@ public ApiResponse> GetTagsForScheduleWithHttpInfo(string name) { // verify the required parameter 'name' is set if (name == null) - throw new ApiException(400, "Missing required parameter 'name' when calling SchedulerResourceApi->GetTagsForSchedule"); + throw new ApiException(400, + "Missing required parameter 'name' when calling SchedulerResourceApi->GetTagsForSchedule"); var localVarPath = "/scheduler/schedules/{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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 (name != null) + localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetTagsForSchedule", localVarResponse); + var exception = ExceptionFactory("GetTagsForSchedule", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// - /// Pause all scheduling in a single conductor server instance (for debugging only) + /// Pause all scheduling in a single conductor server instance (for debugging only) /// /// Thrown when fails to make API call /// Dictionary<string, Object> - public Dictionary PauseAllSchedules() + public Dictionary PauseAllSchedules() { - ApiResponse> localVarResponse = PauseAllSchedulesWithHttpInfo(); + var localVarResponse = PauseAllSchedulesWithHttpInfo(); return localVarResponse.Data; } /// - /// Pause all scheduling in a single conductor server instance (for debugging only) + /// Pause all scheduling in a single conductor server instance (for debugging only) /// /// Thrown when fails to make API call /// ApiResponse of Dictionary<string, Object> - public ApiResponse> PauseAllSchedulesWithHttpInfo() + public ApiResponse> PauseAllSchedulesWithHttpInfo() { - var localVarPath = "/scheduler/admin/pause"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("PauseAllSchedules", localVarResponse); + var exception = ExceptionFactory("PauseAllSchedules", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, + return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Dictionary)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + (Dictionary)Configuration.ApiClient.Deserialize(localVarResponse, + typeof(Dictionary))); } /// - /// Pauses an existing schedule by name + /// Pauses an existing schedule by name /// /// Thrown when fails to make API call /// /// Object - public Object PauseSchedule(string name) + public object PauseSchedule(string name) { - ApiResponse localVarResponse = PauseScheduleWithHttpInfo(name); + var localVarResponse = PauseScheduleWithHttpInfo(name); return localVarResponse.Data; } /// - /// Pauses an existing schedule by name + /// Pauses an existing schedule by name /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse PauseScheduleWithHttpInfo(string name) + public ApiResponse PauseScheduleWithHttpInfo(string name) { // verify the required parameter 'name' is set if (name == null) - throw new ApiException(400, "Missing required parameter 'name' when calling SchedulerResourceApi->PauseSchedule"); + throw new ApiException(400, + "Missing required parameter 'name' when calling SchedulerResourceApi->PauseSchedule"); var localVarPath = "/scheduler/schedules/{name}/pause"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 (name != null) + localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("PauseSchedule", localVarResponse); + var exception = ExceptionFactory("PauseSchedule", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Put a tag to schedule + /// Put a tag to schedule /// /// Thrown when fails to make API call /// @@ -1002,353 +690,357 @@ public void PutTagForSchedule(List body, string name) } /// - /// Put a tag to schedule + /// Put a tag to schedule /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object(void) - public ApiResponse PutTagForScheduleWithHttpInfo(List body, string name) + public ApiResponse PutTagForScheduleWithHttpInfo(List body, string name) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling SchedulerResourceApi->PutTagForSchedule"); + throw new ApiException(400, + "Missing required parameter 'body' when calling SchedulerResourceApi->PutTagForSchedule"); // verify the required parameter 'name' is set if (name == null) - throw new ApiException(400, "Missing required parameter 'name' when calling SchedulerResourceApi->PutTagForSchedule"); + throw new ApiException(400, + "Missing required parameter 'name' when calling SchedulerResourceApi->PutTagForSchedule"); var localVarPath = "/scheduler/schedules/{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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 (name != null) + localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("PutTagForSchedule", localVarResponse); + var exception = ExceptionFactory("PutTagForSchedule", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// - /// Requeue all execution records + /// Requeue all execution records /// /// Thrown when fails to make API call /// Dictionary<string, Object> - public Dictionary RequeueAllExecutionRecords() + public Dictionary RequeueAllExecutionRecords() { - ApiResponse> localVarResponse = RequeueAllExecutionRecordsWithHttpInfo(); + var localVarResponse = RequeueAllExecutionRecordsWithHttpInfo(); return localVarResponse.Data; } /// - /// Requeue all execution records + /// Requeue all execution records /// /// Thrown when fails to make API call /// ApiResponse of Dictionary<string, Object> - public ApiResponse> RequeueAllExecutionRecordsWithHttpInfo() + public ApiResponse> RequeueAllExecutionRecordsWithHttpInfo() { - var localVarPath = "/scheduler/admin/requeue"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("RequeueAllExecutionRecords", localVarResponse); + var exception = ExceptionFactory("RequeueAllExecutionRecords", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, + return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Dictionary)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + (Dictionary)Configuration.ApiClient.Deserialize(localVarResponse, + typeof(Dictionary))); } /// - /// Resume all scheduling + /// Resume all scheduling /// /// Thrown when fails to make API call /// Dictionary<string, Object> - public Dictionary ResumeAllSchedules() + public Dictionary ResumeAllSchedules() { - ApiResponse> localVarResponse = ResumeAllSchedulesWithHttpInfo(); + var localVarResponse = ResumeAllSchedulesWithHttpInfo(); return localVarResponse.Data; } /// - /// Resume all scheduling + /// Resume all scheduling /// /// Thrown when fails to make API call /// ApiResponse of Dictionary<string, Object> - public ApiResponse> ResumeAllSchedulesWithHttpInfo() + public ApiResponse> ResumeAllSchedulesWithHttpInfo() { - var localVarPath = "/scheduler/admin/resume"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("ResumeAllSchedules", localVarResponse); + var exception = ExceptionFactory("ResumeAllSchedules", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, + return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Dictionary)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + (Dictionary)Configuration.ApiClient.Deserialize(localVarResponse, + typeof(Dictionary))); } /// - /// Resume a paused schedule by name + /// Resume a paused schedule by name /// /// Thrown when fails to make API call /// /// Object - public Object ResumeSchedule(string name) + public object ResumeSchedule(string name) { - ApiResponse localVarResponse = ResumeScheduleWithHttpInfo(name); + var localVarResponse = ResumeScheduleWithHttpInfo(name); return localVarResponse.Data; } /// - /// Resume a paused schedule by name + /// Resume a paused schedule by name /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse ResumeScheduleWithHttpInfo(string name) + public ApiResponse ResumeScheduleWithHttpInfo(string name) { // verify the required parameter 'name' is set if (name == null) - throw new ApiException(400, "Missing required parameter 'name' when calling SchedulerResourceApi->ResumeSchedule"); + throw new ApiException(400, + "Missing required parameter 'name' when calling SchedulerResourceApi->ResumeSchedule"); var localVarPath = "/scheduler/schedules/{name}/resume"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 (name != null) + localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("ResumeSchedule", localVarResponse); + var exception = ExceptionFactory("ResumeSchedule", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Create or update a schedule for a specified workflow with a corresponding start workflow request + /// Create or update a schedule for a specified workflow with a corresponding start workflow request /// /// Thrown when fails to make API call /// /// Object - public Object SaveSchedule(SaveScheduleRequest body) + public object SaveSchedule(SaveScheduleRequest body) { - ApiResponse localVarResponse = SaveScheduleWithHttpInfo(body); + var localVarResponse = SaveScheduleWithHttpInfo(body); return localVarResponse.Data; } /// - /// Create or update a schedule for a specified workflow with a corresponding start workflow request + /// Create or update a schedule for a specified workflow with a corresponding start workflow request /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse SaveScheduleWithHttpInfo(SaveScheduleRequest body) + public ApiResponse SaveScheduleWithHttpInfo(SaveScheduleRequest body) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling SchedulerResourceApi->SaveSchedule"); + throw new ApiException(400, + "Missing required parameter 'body' when calling SchedulerResourceApi->SaveSchedule"); var localVarPath = "/scheduler/schedules"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("SaveSchedule", localVarResponse); + var exception = ExceptionFactory("SaveSchedule", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Search for workflows based on payload and other parameters use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. + /// Search for workflows based on payload and other parameters use sort options as sort=<field>:ASC|DESC + /// e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. /// /// Thrown when fails to make API call /// (optional, default to 0) @@ -1357,14 +1049,16 @@ public ApiResponse SaveScheduleWithHttpInfo(SaveScheduleRequest body) /// (optional, default to *) /// (optional) /// SearchResultWorkflowScheduleExecutionModel - public SearchResultWorkflowScheduleExecutionModel SearchV22(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null) + public SearchResultWorkflowScheduleExecutionModel SearchV22(int? start = null, int? size = null, + string sort = null, string freeText = null, string query = null) { - ApiResponse localVarResponse = SearchV22WithHttpInfo(start, size, sort, freeText, query); + var localVarResponse = SearchV22WithHttpInfo(start, size, sort, freeText, query); return localVarResponse.Data; } /// - /// Search for workflows based on payload and other parameters use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. + /// Search for workflows based on payload and other parameters use sort options as sort=<field>:ASC|DESC + /// e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC. /// /// Thrown when fails to make API call /// (optional, default to 0) @@ -1373,61 +1067,73 @@ public SearchResultWorkflowScheduleExecutionModel SearchV22(int? start = null, i /// (optional, default to *) /// (optional) /// ApiResponse of SearchResultWorkflowScheduleExecutionModel - public ApiResponse SearchV22WithHttpInfo(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null) + public ApiResponse SearchV22WithHttpInfo(int? start = null, + int? size = null, string sort = null, string freeText = null, string query = null) { - var localVarPath = "/scheduler/search/executions"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (start != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "start", start)); // query parameter - if (size != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "size", size)); // query parameter - if (sort != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter - if (freeText != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "freeText", freeText)); // query parameter - if (query != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query", query)); // query parameter + if (start != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "start", start)); // query parameter + if (size != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "size", size)); // query parameter + if (sort != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "sort", sort)); // query parameter + if (freeText != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "freeText", freeText)); // query parameter + if (query != null) + localVarQueryParams.AddRange( + Configuration.ApiClient.ParameterToKeyValuePairs("", "query", query)); // query parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("SearchV22", localVarResponse); + var exception = ExceptionFactory("SearchV22", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (SearchResultWorkflowScheduleExecutionModel)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(SearchResultWorkflowScheduleExecutionModel))); + (SearchResultWorkflowScheduleExecutionModel)Configuration.ApiClient.Deserialize(localVarResponse, + typeof(SearchResultWorkflowScheduleExecutionModel))); } /// - /// Test timeout - do not use in production + /// Test timeout - do not use in production /// /// Thrown when fails to make API call /// @@ -1437,55 +1143,64 @@ public void TestTimeout() } /// - /// Test timeout - do not use in production + /// Test timeout - do not use in production /// /// Thrown when fails to make API call /// ApiResponse of Object(void) - public ApiResponse TestTimeoutWithHttpInfo() + public ApiResponse TestTimeoutWithHttpInfo() { - var localVarPath = "/scheduler/test/timeout"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("TestTimeout", localVarResponse); + var exception = ExceptionFactory("TestTimeout", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } } -} +} \ No newline at end of file diff --git a/Conductor/Api/SecretResourceApi.cs b/Conductor/Api/SecretResourceApi.cs index 6374340d..b46596fa 100644 --- a/Conductor/Api/SecretResourceApi.cs +++ b/Conductor/Api/SecretResourceApi.cs @@ -1,379 +1,152 @@ using System; using System.Collections.Generic; using System.Linq; -using RestSharp; using Conductor.Client; using Conductor.Client.Models; +using RestSharp; namespace Conductor.Api { /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface ISecretResourceApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Delete a secret value by key - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object DeleteSecret(string key); - - /// - /// Delete a secret value by key - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse DeleteSecretWithHttpInfo(string key); - /// - /// Delete tags of the secret - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - void DeleteTagForSecret(List body, string key); - - /// - /// Delete tags of the secret - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object(void) - ApiResponse DeleteTagForSecretWithHttpInfo(List body, string key); - /// - /// Get secret value by key - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object GetSecret(string key); - - /// - /// Get secret value by key - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse GetSecretWithHttpInfo(string key); - /// - /// Get tags by secret - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// List<TagObject> - List GetTags(string key); - - /// - /// Get tags by secret - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of List<TagObject> - ApiResponse> GetTagsWithHttpInfo(string key); - /// - /// List all secret names - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Object - Object ListAllSecretNames(); - - /// - /// List all secret names - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of Object - ApiResponse ListAllSecretNamesWithHttpInfo(); - /// - /// List all secret names user can grant access to - /// - /// - /// - /// - /// Thrown when fails to make API call - /// List<string> - List ListSecretsThatUserCanGrantAccessTo(); - - /// - /// List all secret names user can grant access to - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of List<string> - ApiResponse> ListSecretsThatUserCanGrantAccessToWithHttpInfo(); - /// - /// List all secret names along with tags user can grant access to - /// - /// - /// - /// - /// Thrown when fails to make API call - /// List<ExtendedSecret> - List ListSecretsWithTagsThatUserCanGrantAccessTo(); - - /// - /// List all secret names along with tags user can grant access to - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of List<ExtendedSecret> - ApiResponse> ListSecretsWithTagsThatUserCanGrantAccessToWithHttpInfo(); - /// - /// Put a secret value by key - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object PutSecret(string body, string key); - - /// - /// Put a secret value by key - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse PutSecretWithHttpInfo(string body, string key); - /// - /// Tag a secret - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - void PutTagForSecret(List body, string key); - - /// - /// Tag a secret - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object(void) - ApiResponse PutTagForSecretWithHttpInfo(List body, string key); - /// - /// Check if secret exists - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Object - Object SecretExists(string key); - - /// - /// Check if secret exists - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Object - ApiResponse SecretExistsWithHttpInfo(string key); - #endregion Synchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public partial class SecretResourceApi : ISecretResourceApi + public class SecretResourceApi : ISecretResourceApi { - private Conductor.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + private ExceptionFactory _exceptionFactory = (name, response) => null; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - public SecretResourceApi(String basePath) + public SecretResourceApi(string basePath) { - this.Configuration = new Conductor.Client.Configuration { BasePath = basePath }; + Configuration = new Configuration { BasePath = basePath }; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// /// public SecretResourceApi() { - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class - /// using Configuration object + /// Initializes a new instance of the class + /// using Configuration object /// /// An instance of Configuration /// - public SecretResourceApi(Conductor.Client.Configuration configuration = null) + public SecretResourceApi(Configuration configuration = null) { if (configuration == null) // use the default one in Configuration - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; else - this.Configuration = configuration; - - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; - } + Configuration = configuration; - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Gets or sets the configuration object + /// Gets or sets the configuration object /// /// An instance of the Configuration - public Conductor.Client.Configuration Configuration { get; set; } + public Configuration Configuration { get; set; } /// - /// Provides a factory method hook for the creation of exceptions. + /// Provides a factory method hook for the creation of exceptions. /// - public Conductor.Client.ExceptionFactory ExceptionFactory + public ExceptionFactory ExceptionFactory { get { if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } return _exceptionFactory; } - set { _exceptionFactory = value; } + set => _exceptionFactory = value; } /// - /// Delete a secret value by key + /// Delete a secret value by key /// /// Thrown when fails to make API call /// /// Object - public Object DeleteSecret(string key) + public object DeleteSecret(string key) { - ApiResponse localVarResponse = DeleteSecretWithHttpInfo(key); + var localVarResponse = DeleteSecretWithHttpInfo(key); return localVarResponse.Data; } /// - /// Delete a secret value by key + /// Delete a secret value by key /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse DeleteSecretWithHttpInfo(string key) + public ApiResponse DeleteSecretWithHttpInfo(string key) { // verify the required parameter 'key' is set if (key == null) - throw new ApiException(400, "Missing required parameter 'key' when calling SecretResourceApi->DeleteSecret"); + throw new ApiException(400, + "Missing required parameter 'key' when calling SecretResourceApi->DeleteSecret"); var localVarPath = "/secrets/{key}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (key != null) localVarPathParams.Add("key", this.Configuration.ApiClient.ParameterToString(key)); // path parameter + if (key != null) + localVarPathParams.Add("key", Configuration.ApiClient.ParameterToString(key)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("DeleteSecret", localVarResponse); + var exception = ExceptionFactory("DeleteSecret", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Delete tags of the secret + /// Delete tags of the secret /// /// Thrown when fails to make API call /// @@ -385,159 +158,162 @@ public void DeleteTagForSecret(List body, string key) } /// - /// Delete tags of the secret + /// Delete tags of the secret /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object(void) - public ApiResponse DeleteTagForSecretWithHttpInfo(List body, string key) + public ApiResponse DeleteTagForSecretWithHttpInfo(List body, string key) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling SecretResourceApi->DeleteTagForSecret"); + throw new ApiException(400, + "Missing required parameter 'body' when calling SecretResourceApi->DeleteTagForSecret"); // verify the required parameter 'key' is set if (key == null) - throw new ApiException(400, "Missing required parameter 'key' when calling SecretResourceApi->DeleteTagForSecret"); + throw new ApiException(400, + "Missing required parameter 'key' when calling SecretResourceApi->DeleteTagForSecret"); var localVarPath = "/secrets/{key}/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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (key != null) localVarPathParams.Add("key", this.Configuration.ApiClient.ParameterToString(key)); // path parameter + if (key != null) + localVarPathParams.Add("key", Configuration.ApiClient.ParameterToString(key)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("DeleteTagForSecret", localVarResponse); + var exception = ExceptionFactory("DeleteTagForSecret", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// - /// Get secret value by key + /// Get secret value by key /// /// Thrown when fails to make API call /// /// Object - public Object GetSecret(string key) + public object GetSecret(string key) { - ApiResponse localVarResponse = GetSecretWithHttpInfo(key); + var localVarResponse = GetSecretWithHttpInfo(key); return localVarResponse.Data; } /// - /// Get secret value by key + /// Get secret value by key /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse GetSecretWithHttpInfo(string key) + public ApiResponse GetSecretWithHttpInfo(string key) { // verify the required parameter 'key' is set if (key == null) - throw new ApiException(400, "Missing required parameter 'key' when calling SecretResourceApi->GetSecret"); + throw new ApiException(400, + "Missing required parameter 'key' when calling SecretResourceApi->GetSecret"); var localVarPath = "/secrets/{key}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (key != null) localVarPathParams.Add("key", this.Configuration.ApiClient.ParameterToString(key)); // path parameter + if (key != null) + localVarPathParams.Add("key", Configuration.ApiClient.ParameterToString(key)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetSecret", localVarResponse); + var exception = ExceptionFactory("GetSecret", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Get tags by secret + /// Get tags by secret /// /// Thrown when fails to make API call /// /// List<TagObject> public List GetTags(string key) { - ApiResponse> localVarResponse = GetTagsWithHttpInfo(key); + var localVarResponse = GetTagsWithHttpInfo(key); return localVarResponse.Data; } /// - /// Get tags by secret + /// Get tags by secret /// /// Thrown when fails to make API call /// @@ -549,329 +325,332 @@ public ApiResponse> GetTagsWithHttpInfo(string key) throw new ApiException(400, "Missing required parameter 'key' when calling SecretResourceApi->GetTags"); var localVarPath = "/secrets/{key}/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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (key != null) localVarPathParams.Add("key", this.Configuration.ApiClient.ParameterToString(key)); // path parameter + if (key != null) + localVarPathParams.Add("key", Configuration.ApiClient.ParameterToString(key)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetTags", localVarResponse); + var exception = ExceptionFactory("GetTags", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// - /// List all secret names + /// List all secret names /// /// Thrown when fails to make API call /// Object - public Object ListAllSecretNames() + public object ListAllSecretNames() { - ApiResponse localVarResponse = ListAllSecretNamesWithHttpInfo(); + var localVarResponse = ListAllSecretNamesWithHttpInfo(); return localVarResponse.Data; } /// - /// List all secret names + /// List all secret names /// /// Thrown when fails to make API call /// ApiResponse of Object - public ApiResponse ListAllSecretNamesWithHttpInfo() + public ApiResponse ListAllSecretNamesWithHttpInfo() { - var localVarPath = "/secrets"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("ListAllSecretNames", localVarResponse); + var exception = ExceptionFactory("ListAllSecretNames", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// List all secret names user can grant access to + /// List all secret names user can grant access to /// /// Thrown when fails to make API call /// List<string> public List ListSecretsThatUserCanGrantAccessTo() { - ApiResponse> localVarResponse = ListSecretsThatUserCanGrantAccessToWithHttpInfo(); + var localVarResponse = ListSecretsThatUserCanGrantAccessToWithHttpInfo(); return localVarResponse.Data; } /// - /// List all secret names user can grant access to + /// List all secret names user can grant access to /// /// Thrown when fails to make API call /// ApiResponse of List<string> public ApiResponse> ListSecretsThatUserCanGrantAccessToWithHttpInfo() { - var localVarPath = "/secrets"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("ListSecretsThatUserCanGrantAccessTo", localVarResponse); + var exception = ExceptionFactory("ListSecretsThatUserCanGrantAccessTo", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// - /// List all secret names along with tags user can grant access to + /// List all secret names along with tags user can grant access to /// /// Thrown when fails to make API call /// List<ExtendedSecret> public List ListSecretsWithTagsThatUserCanGrantAccessTo() { - ApiResponse> localVarResponse = ListSecretsWithTagsThatUserCanGrantAccessToWithHttpInfo(); + var localVarResponse = ListSecretsWithTagsThatUserCanGrantAccessToWithHttpInfo(); return localVarResponse.Data; } /// - /// List all secret names along with tags user can grant access to + /// List all secret names along with tags user can grant access to /// /// Thrown when fails to make API call /// ApiResponse of List<ExtendedSecret> public ApiResponse> ListSecretsWithTagsThatUserCanGrantAccessToWithHttpInfo() { - var localVarPath = "/secrets-v2"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("ListSecretsWithTagsThatUserCanGrantAccessTo", localVarResponse); + var exception = ExceptionFactory("ListSecretsWithTagsThatUserCanGrantAccessTo", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, + typeof(List))); } /// - /// Put a secret value by key + /// Put a secret value by key /// /// Thrown when fails to make API call /// /// /// Object - public Object PutSecret(string body, string key) + public object PutSecret(string body, string key) { - ApiResponse localVarResponse = PutSecretWithHttpInfo(body, key); + var localVarResponse = PutSecretWithHttpInfo(body, key); return localVarResponse.Data; } /// - /// Put a secret value by key + /// Put a secret value by key /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse PutSecretWithHttpInfo(string body, string key) + public ApiResponse PutSecretWithHttpInfo(string body, string key) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling SecretResourceApi->PutSecret"); + throw new ApiException(400, + "Missing required parameter 'body' when calling SecretResourceApi->PutSecret"); // verify the required parameter 'key' is set if (key == null) - throw new ApiException(400, "Missing required parameter 'key' when calling SecretResourceApi->PutSecret"); + throw new ApiException(400, + "Missing required parameter 'key' when calling SecretResourceApi->PutSecret"); var localVarPath = "/secrets/{key}"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (key != null) localVarPathParams.Add("key", this.Configuration.ApiClient.ParameterToString(key)); // path parameter + if (key != null) + localVarPathParams.Add("key", Configuration.ApiClient.ParameterToString(key)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("PutSecret", localVarResponse); + var exception = ExceptionFactory("PutSecret", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Tag a secret + /// Tag a secret /// /// Thrown when fails to make API call /// @@ -883,143 +662,155 @@ public void PutTagForSecret(List body, string key) } /// - /// Tag a secret + /// Tag a secret /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object(void) - public ApiResponse PutTagForSecretWithHttpInfo(List body, string key) + public ApiResponse PutTagForSecretWithHttpInfo(List body, string key) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling SecretResourceApi->PutTagForSecret"); + throw new ApiException(400, + "Missing required parameter 'body' when calling SecretResourceApi->PutTagForSecret"); // verify the required parameter 'key' is set if (key == null) - throw new ApiException(400, "Missing required parameter 'key' when calling SecretResourceApi->PutTagForSecret"); + throw new ApiException(400, + "Missing required parameter 'key' when calling SecretResourceApi->PutTagForSecret"); var localVarPath = "/secrets/{key}/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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (key != null) localVarPathParams.Add("key", this.Configuration.ApiClient.ParameterToString(key)); // path parameter + if (key != null) + localVarPathParams.Add("key", Configuration.ApiClient.ParameterToString(key)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("PutTagForSecret", localVarResponse); + var exception = ExceptionFactory("PutTagForSecret", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null); } /// - /// Check if secret exists + /// Check if secret exists /// /// Thrown when fails to make API call /// /// Object - public Object SecretExists(string key) + public object SecretExists(string key) { - ApiResponse localVarResponse = SecretExistsWithHttpInfo(key); + var localVarResponse = SecretExistsWithHttpInfo(key); return localVarResponse.Data; } /// - /// Check if secret exists + /// Check if secret exists /// /// Thrown when fails to make API call /// /// ApiResponse of Object - public ApiResponse SecretExistsWithHttpInfo(string key) + public ApiResponse SecretExistsWithHttpInfo(string key) { // verify the required parameter 'key' is set if (key == null) - throw new ApiException(400, "Missing required parameter 'key' when calling SecretResourceApi->SecretExists"); + throw new ApiException(400, + "Missing required parameter 'key' when calling SecretResourceApi->SecretExists"); var localVarPath = "/secrets/{key}/exists"; - 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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (key != null) localVarPathParams.Add("key", this.Configuration.ApiClient.ParameterToString(key)); // path parameter + if (key != null) + localVarPathParams.Add("key", Configuration.ApiClient.ParameterToString(key)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("SecretExists", localVarResponse); + var exception = ExceptionFactory("SecretExists", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return Configuration.ApiClient.RestClient.BaseUrl.ToString(); } } -} +} \ No newline at end of file diff --git a/Conductor/Api/TagsApi.cs b/Conductor/Api/TagsApi.cs index a959ab3f..46c843df 100644 --- a/Conductor/Api/TagsApi.cs +++ b/Conductor/Api/TagsApi.cs @@ -1,318 +1,98 @@ using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Linq; -using RestSharp; using Conductor.Client; using Conductor.Client.Models; +using RestSharp; namespace Conductor.Api { /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public interface ITagsApi : IApiAccessor + public class TagsApi : ITagsApi { - #region Synchronous Operations - /// - /// Adds the tag to the task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object AddTaskTag(TagObject body, string taskName); - - /// - /// Adds the tag to the task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse AddTaskTagWithHttpInfo(TagObject body, string taskName); - /// - /// Adds the tag to the workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object AddWorkflowTag(TagObject body, string name); - - /// - /// Adds the tag to the workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse AddWorkflowTagWithHttpInfo(TagObject body, string name); - /// - /// Removes the tag of the task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object DeleteTaskTag(TagString body, string taskName); - - /// - /// Removes the tag of the task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse DeleteTaskTagWithHttpInfo(TagString body, string taskName); - /// - /// Removes the tag of the workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object DeleteWorkflowTag(TagObject body, string name); + private ExceptionFactory _exceptionFactory = (name, response) => null; /// - /// Removes the tag of the workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse DeleteWorkflowTagWithHttpInfo(TagObject body, string name); - /// - /// List all tags - /// - /// - /// - /// - /// Thrown when fails to make API call - /// List<TagObject> - List GetTags(); - - /// - /// List all tags - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of List<TagObject> - ApiResponse> GetTagsWithHttpInfo(); - /// - /// Returns all the tags of the task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// List<TagObject> - List GetTaskTags(string taskName); - - /// - /// Returns all the tags of the task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of List<TagObject> - ApiResponse> GetTaskTagsWithHttpInfo(string taskName); - /// - /// Returns all the tags of the workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// List<TagObject> - List GetWorkflowTags(string name); - - /// - /// Returns all the tags of the workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of List<TagObject> - ApiResponse> GetWorkflowTagsWithHttpInfo(string name); - /// - /// Adds the tag to the task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object SetTaskTags(List body, string taskName); - - /// - /// Adds the tag to the task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse SetTaskTagsWithHttpInfo(List body, string taskName); - /// - /// Set the tags of the workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// Object - Object SetWorkflowTags(List body, string name); - - /// - /// Set the tags of the workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object - ApiResponse SetWorkflowTagsWithHttpInfo(List body, string name); - #endregion Synchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class TagsApi : ITagsApi - { - private Conductor.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - public TagsApi(String basePath) + public TagsApi(string basePath) { - this.Configuration = new Conductor.Client.Configuration { BasePath = basePath }; + Configuration = new Configuration { BasePath = basePath }; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// /// public TagsApi() { - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Initializes a new instance of the class - /// using Configuration object + /// Initializes a new instance of the class + /// using Configuration object /// /// An instance of Configuration /// - public TagsApi(Conductor.Client.Configuration configuration = null) + public TagsApi(Configuration configuration = null) { if (configuration == null) // use the default one in Configuration - this.Configuration = Conductor.Client.Configuration.Default; + Configuration = Configuration.Default; else - this.Configuration = configuration; + Configuration = configuration; - ExceptionFactory = Conductor.Client.Configuration.DefaultExceptionFactory; + ExceptionFactory = Configuration.DefaultExceptionFactory; } /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Gets or sets the configuration object + /// Gets or sets the configuration object /// /// An instance of the Configuration - public Conductor.Client.Configuration Configuration { get; set; } + public Configuration Configuration { get; set; } /// - /// Provides a factory method hook for the creation of exceptions. + /// Provides a factory method hook for the creation of exceptions. /// - public Conductor.Client.ExceptionFactory ExceptionFactory + public ExceptionFactory ExceptionFactory { get { if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } return _exceptionFactory; } - set { _exceptionFactory = value; } + set => _exceptionFactory = value; } /// - /// Adds the tag to the task + /// Adds the tag to the task /// /// Thrown when fails to make API call /// /// /// Object - public Object AddTaskTag(TagObject body, string taskName) + public object AddTaskTag(TagObject body, string taskName) { - ApiResponse localVarResponse = AddTaskTagWithHttpInfo(body, taskName); + var localVarResponse = AddTaskTagWithHttpInfo(body, taskName); return localVarResponse.Data; } /// - /// Adds the tag to the task + /// Adds the tag to the task /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse AddTaskTagWithHttpInfo(TagObject body, string taskName) + public ApiResponse AddTaskTagWithHttpInfo(TagObject body, string taskName) { // verify the required parameter 'body' is set if (body == null) @@ -322,81 +102,80 @@ public ApiResponse AddTaskTagWithHttpInfo(TagObject body, string taskNam throw new ApiException(400, "Missing required parameter 'taskName' when calling TagsApi->AddTaskTag"); var localVarPath = "/metadata/task/{taskName}/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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (taskName != null) localVarPathParams.Add("taskName", this.Configuration.ApiClient.ParameterToString(taskName)); // path parameter + if (taskName != null) + localVarPathParams.Add("taskName", + Configuration.ApiClient.ParameterToString(taskName)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("AddTaskTag", localVarResponse); + var exception = ExceptionFactory("AddTaskTag", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Adds the tag to the workflow + /// Adds the tag to the workflow /// /// Thrown when fails to make API call /// /// /// Object - public Object AddWorkflowTag(TagObject body, string name) + public object AddWorkflowTag(TagObject body, string name) { - ApiResponse localVarResponse = AddWorkflowTagWithHttpInfo(body, name); + var localVarResponse = AddWorkflowTagWithHttpInfo(body, name); return localVarResponse.Data; } /// - /// Adds the tag to the workflow + /// Adds the tag to the workflow /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse AddWorkflowTagWithHttpInfo(TagObject body, string name) + public ApiResponse AddWorkflowTagWithHttpInfo(TagObject body, string name) { // verify the required parameter 'body' is set if (body == null) @@ -406,306 +185,304 @@ public ApiResponse AddWorkflowTagWithHttpInfo(TagObject body, string nam throw new ApiException(400, "Missing required parameter 'name' when calling TagsApi->AddWorkflowTag"); var localVarPath = "/metadata/workflow/{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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 (name != null) + localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("AddWorkflowTag", localVarResponse); + var exception = ExceptionFactory("AddWorkflowTag", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Removes the tag of the task + /// Removes the tag of the task /// /// Thrown when fails to make API call /// /// /// Object - public Object DeleteTaskTag(TagString body, string taskName) + public object DeleteTaskTag(TagString body, string taskName) { - ApiResponse localVarResponse = DeleteTaskTagWithHttpInfo(body, taskName); + var localVarResponse = DeleteTaskTagWithHttpInfo(body, taskName); return localVarResponse.Data; } /// - /// Removes the tag of the task + /// Removes the tag of the task /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse DeleteTaskTagWithHttpInfo(TagString body, string taskName) + public ApiResponse DeleteTaskTagWithHttpInfo(TagString body, string taskName) { // verify the required parameter 'body' is set if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling TagsApi->DeleteTaskTag"); // verify the required parameter 'taskName' is set if (taskName == null) - throw new ApiException(400, "Missing required parameter 'taskName' when calling TagsApi->DeleteTaskTag"); + throw new ApiException(400, + "Missing required parameter 'taskName' when calling TagsApi->DeleteTaskTag"); var localVarPath = "/metadata/task/{taskName}/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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (taskName != null) localVarPathParams.Add("taskName", this.Configuration.ApiClient.ParameterToString(taskName)); // path parameter + if (taskName != null) + localVarPathParams.Add("taskName", + Configuration.ApiClient.ParameterToString(taskName)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("DeleteTaskTag", localVarResponse); + var exception = ExceptionFactory("DeleteTaskTag", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Removes the tag of the workflow + /// Removes the tag of the workflow /// /// Thrown when fails to make API call /// /// /// Object - public Object DeleteWorkflowTag(TagObject body, string name) + public object DeleteWorkflowTag(TagObject body, string name) { - ApiResponse localVarResponse = DeleteWorkflowTagWithHttpInfo(body, name); + var localVarResponse = DeleteWorkflowTagWithHttpInfo(body, name); return localVarResponse.Data; } /// - /// Removes the tag of the workflow + /// Removes the tag of the workflow /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse DeleteWorkflowTagWithHttpInfo(TagObject body, string name) + public ApiResponse DeleteWorkflowTagWithHttpInfo(TagObject body, string name) { // verify the required parameter 'body' is set if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling TagsApi->DeleteWorkflowTag"); + throw new ApiException(400, + "Missing required parameter 'body' when calling TagsApi->DeleteWorkflowTag"); // verify the required parameter 'name' is set if (name == null) - throw new ApiException(400, "Missing required parameter 'name' when calling TagsApi->DeleteWorkflowTag"); + throw new ApiException(400, + "Missing required parameter 'name' when calling TagsApi->DeleteWorkflowTag"); var localVarPath = "/metadata/workflow/{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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 (name != null) + localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("DeleteWorkflowTag", localVarResponse); + var exception = ExceptionFactory("DeleteWorkflowTag", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// List all tags + /// List all tags /// /// Thrown when fails to make API call /// List<TagObject> public List GetTags() { - ApiResponse> localVarResponse = GetTagsWithHttpInfo(); + var localVarResponse = GetTagsWithHttpInfo(); return localVarResponse.Data; } /// - /// List all tags + /// List all tags /// /// Thrown when fails to make API call /// ApiResponse of List<TagObject> public ApiResponse> GetTagsWithHttpInfo() { - var localVarPath = "/metadata/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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetTags", localVarResponse); + var exception = ExceptionFactory("GetTags", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// - /// Returns all the tags of the task + /// Returns all the tags of the task /// /// Thrown when fails to make API call /// /// List<TagObject> public List GetTaskTags(string taskName) { - ApiResponse> localVarResponse = GetTaskTagsWithHttpInfo(taskName); + var localVarResponse = GetTaskTagsWithHttpInfo(taskName); return localVarResponse.Data; } /// - /// Returns all the tags of the task + /// Returns all the tags of the task /// /// Thrown when fails to make API call /// @@ -717,65 +494,68 @@ public ApiResponse> GetTaskTagsWithHttpInfo(string taskName) throw new ApiException(400, "Missing required parameter 'taskName' when calling TagsApi->GetTaskTags"); var localVarPath = "/metadata/task/{taskName}/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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (taskName != null) localVarPathParams.Add("taskName", this.Configuration.ApiClient.ParameterToString(taskName)); // path parameter + if (taskName != null) + localVarPathParams.Add("taskName", + Configuration.ApiClient.ParameterToString(taskName)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetTaskTags", localVarResponse); + var exception = ExceptionFactory("GetTaskTags", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// - /// Returns all the tags of the workflow + /// Returns all the tags of the workflow /// /// Thrown when fails to make API call /// /// List<TagObject> public List GetWorkflowTags(string name) { - ApiResponse> localVarResponse = GetWorkflowTagsWithHttpInfo(name); + var localVarResponse = GetWorkflowTagsWithHttpInfo(name); return localVarResponse.Data; } /// - /// Returns all the tags of the workflow + /// Returns all the tags of the workflow /// /// Thrown when fails to make API call /// @@ -787,72 +567,74 @@ public ApiResponse> GetWorkflowTagsWithHttpInfo(string name) throw new ApiException(400, "Missing required parameter 'name' when calling TagsApi->GetWorkflowTags"); var localVarPath = "/metadata/workflow/{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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "application/json" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 (name != null) + localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("GetWorkflowTags", localVarResponse); + var exception = ExceptionFactory("GetWorkflowTags", 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))); + (List)Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// - /// Adds the tag to the task + /// Adds the tag to the task /// /// Thrown when fails to make API call /// /// /// Object - public Object SetTaskTags(List body, string taskName) + public object SetTaskTags(List body, string taskName) { - ApiResponse localVarResponse = SetTaskTagsWithHttpInfo(body, taskName); + var localVarResponse = SetTaskTagsWithHttpInfo(body, taskName); return localVarResponse.Data; } /// - /// Adds the tag to the task + /// Adds the tag to the task /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse SetTaskTagsWithHttpInfo(List body, string taskName) + public ApiResponse SetTaskTagsWithHttpInfo(List body, string taskName) { // verify the required parameter 'body' is set if (body == null) @@ -862,81 +644,80 @@ public ApiResponse SetTaskTagsWithHttpInfo(List body, string throw new ApiException(400, "Missing required parameter 'taskName' when calling TagsApi->SetTaskTags"); var localVarPath = "/metadata/task/{taskName}/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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (taskName != null) localVarPathParams.Add("taskName", this.Configuration.ApiClient.ParameterToString(taskName)); // path parameter + if (taskName != null) + localVarPathParams.Add("taskName", + Configuration.ApiClient.ParameterToString(taskName)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("SetTaskTags", localVarResponse); + var exception = ExceptionFactory("SetTaskTags", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); } /// - /// Set the tags of the workflow + /// Set the tags of the workflow /// /// Thrown when fails to make API call /// /// /// Object - public Object SetWorkflowTags(List body, string name) + public object SetWorkflowTags(List body, string name) { - ApiResponse localVarResponse = SetWorkflowTagsWithHttpInfo(body, name); + var localVarResponse = SetWorkflowTagsWithHttpInfo(body, name); return localVarResponse.Data; } /// - /// Set the tags of the workflow + /// Set the tags of the workflow /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object - public ApiResponse SetWorkflowTagsWithHttpInfo(List body, string name) + public ApiResponse SetWorkflowTagsWithHttpInfo(List body, string name) { // verify the required parameter 'body' is set if (body == null) @@ -946,58 +727,65 @@ public ApiResponse SetWorkflowTagsWithHttpInfo(List body, str throw new ApiException(400, "Missing required parameter 'name' when calling TagsApi->SetWorkflowTags"); var localVarPath = "/metadata/workflow/{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; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + object localVarPostBody = null; // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { + string[] localVarHttpContentTypes = + { "application/json" }; - String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { + string[] localVarHttpHeaderAccepts = + { "*/*" }; - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + var localVarHttpHeaderAccept = 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 (name != null) + localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter if (body != null && body.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter - } + localVarPostBody = 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; - } + if (!string.IsNullOrEmpty(Configuration.AccessToken)) + localVarHeaderParams["X-Authorization"] = Configuration.AccessToken; // make the HTTP request - IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + var localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int)localVarResponse.StatusCode; + var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("SetWorkflowTags", localVarResponse); + var exception = ExceptionFactory("SetWorkflowTags", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + Configuration.ApiClient.Deserialize(localVarResponse, typeof(object))); + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return Configuration.ApiClient.RestClient.BaseUrl.ToString(); } } -} +} \ No newline at end of file diff --git a/Conductor/Api/TaskResourceApi.cs b/Conductor/Api/TaskResourceApi.cs index 9c801518..9e782eff 100644 --- a/Conductor/Api/TaskResourceApi.cs +++ b/Conductor/Api/TaskResourceApi.cs @@ -7,430 +7,6 @@ namespace Conductor.Api { - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface ITaskResourceApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Get the details about each queue - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Dictionary<string, long?> - Dictionary All(); - - /// - /// Get the details about each queue - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, long?> - ApiResponse> AllWithHttpInfo(); - /// - /// Get the details about each queue - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Dictionary<string, Dictionary<string, Dictionary<string, long?>>> - Dictionary>> AllVerbose(); - - /// - /// Get the details about each queue - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, Dictionary<string, Dictionary<string, long?>>> - ApiResponse>>> AllVerboseWithHttpInfo(); - /// - /// Batch poll for a task of a certain type - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional) - /// (optional) - /// (optional, default to 1) - /// (optional, default to 100) - /// List<Task> - List BatchPoll(string tasktype, string workerid = null, string domain = null, int? count = null, int? timeout = null); - - /// - /// Batch poll for a task of a certain type - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional) - /// (optional) - /// (optional, default to 1) - /// (optional, default to 100) - /// ApiResponse of List<Task> - ApiResponse> BatchPollWithHttpInfo(string tasktype, string workerid = null, string domain = null, int? count = null, int? timeout = null); - /// - /// Get the last poll data for all task types - /// - /// - /// - /// - /// Thrown when fails to make API call - /// (optional) - /// (optional) - /// (optional) - /// (optional) - /// (optional) - /// (optional) - /// Dictionary<string, Object> - Dictionary GetAllPollData(long? workerSize = null, string workerOpt = null, long? queueSize = null, string queueOpt = null, long? lastPollTimeSize = null, string lastPollTimeOpt = null); - - /// - /// Get the last poll data for all task types - /// - /// - /// - /// - /// Thrown when fails to make API call - /// (optional) - /// (optional) - /// (optional) - /// (optional) - /// (optional) - /// (optional) - /// ApiResponse of Dictionary<string, Object> - ApiResponse> GetAllPollDataWithHttpInfo(long? workerSize = null, string workerOpt = null, long? queueSize = null, string queueOpt = null, long? lastPollTimeSize = null, string lastPollTimeOpt = null); - /// - /// Get the external uri where the task payload is to be stored - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - /// ExternalStorageLocation - ExternalStorageLocation GetExternalStorageLocation(string path, string operation, string payloadType); - - /// - /// Get the external uri where the task payload is to be stored - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - /// ApiResponse of ExternalStorageLocation - ApiResponse GetExternalStorageLocationWithHttpInfo(string path, string operation, string payloadType); - /// - /// Get the last poll data for a given task type - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// List<PollData> - List GetPollData(string taskType); - - /// - /// Get the last poll data for a given task type - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of List<PollData> - ApiResponse> GetPollDataWithHttpInfo(string taskType); - /// - /// Get task by Id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// Task - Task GetTask(string taskId); - - /// - /// Get task by Id - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of Task - ApiResponse GetTaskWithHttpInfo(string taskId); - /// - /// Get Task Execution Logs - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// List<TaskExecLog> - List GetTaskLogs(string taskId); - - /// - /// Get Task Execution Logs - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of List<TaskExecLog> - ApiResponse> GetTaskLogsWithHttpInfo(string taskId); - /// - /// Log Task Execution Details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - void Log(string body, string taskId); - - /// - /// Log Task Execution Details - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// ApiResponse of Object(void) - ApiResponse LogWithHttpInfo(string body, string taskId); - /// - /// Poll for a task of a certain type - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional) - /// (optional) - /// Task - Task Poll(string tasktype, string workerid = null, string domain = null); - - /// - /// Poll for a task of a certain type - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional) - /// (optional) - /// ApiResponse of Task - ApiResponse PollWithHttpInfo(string tasktype, string workerid = null, string domain = null); - /// - /// Requeue pending tasks - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// string - string RequeuePendingTask(string taskType); - - /// - /// Requeue pending tasks - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of string - ApiResponse RequeuePendingTaskWithHttpInfo(string taskType); - /// - /// Search for tasks based in payload and other parameters - /// - /// - /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC - /// - /// Thrown when fails to make API call - /// (optional, default to 0) - /// (optional, default to 100) - /// (optional) - /// (optional, default to *) - /// (optional) - /// SearchResultTaskSummary - SearchResultTaskSummary Search(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); - - /// - /// Search for tasks based in payload and other parameters - /// - /// - /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC - /// - /// Thrown when fails to make API call - /// (optional, default to 0) - /// (optional, default to 100) - /// (optional) - /// (optional, default to *) - /// (optional) - /// ApiResponse of SearchResultTaskSummary - ApiResponse SearchWithHttpInfo(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); - /// - /// Search for tasks based in payload and other parameters - /// - /// - /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC - /// - /// Thrown when fails to make API call - /// (optional, default to 0) - /// (optional, default to 100) - /// (optional) - /// (optional, default to *) - /// (optional) - /// SearchResultTask - SearchResultTask SearchV2(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); - - /// - /// Search for tasks based in payload and other parameters - /// - /// - /// use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC - /// - /// Thrown when fails to make API call - /// (optional, default to 0) - /// (optional, default to 100) - /// (optional) - /// (optional, default to *) - /// (optional) - /// ApiResponse of SearchResultTask - ApiResponse SearchV2WithHttpInfo(int? start = null, int? size = null, string sort = null, string freeText = null, string query = null); - /// - /// Get Task type queue sizes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// (optional) - /// Dictionary<string, int?> - Dictionary Size(List taskType = null); - - /// - /// Get Task type queue sizes - /// - /// - /// - /// - /// Thrown when fails to make API call - /// (optional) - /// ApiResponse of Dictionary<string, int?> - ApiResponse> SizeWithHttpInfo(List taskType = null); - /// - /// Update a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// string - string UpdateTask(TaskResult body); - - /// - /// Update a task - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of string - ApiResponse UpdateTaskWithHttpInfo(TaskResult body); - /// - /// Update a task By Ref Name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - /// - /// (optional) - /// string - string UpdateTask(Dictionary body, string workflowId, string taskRefName, string status, string workerid = null); - - /// - /// Update a task By Ref Name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - /// - /// ApiResponse of string - ApiResponse UpdateTaskWithHttpInfo(Dictionary body, string workflowId, string taskRefName, string status, string workerid = null); - - - //aa - /// - /// Update a task By Ref Name, evaluates the workflow and returns the updated workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - /// - /// (optional) - /// Workflow - Workflow UpdateTaskSync(Dictionary output, string workflowId, string taskRefName, TaskResult.StatusEnum status, string workerid = null); - - /// - /// Update a task By Ref Name - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// - /// - /// - /// ApiResponse of Workflow - ApiResponse UpdateTaskSyncWithHttpInfo(Dictionary output, string workflowId, string taskRefName, TaskResult.StatusEnum status, string workerid = null); - //aaa - #endregion Synchronous Operations - } - /// /// Represents a collection of functions to interact with the API endpoints /// diff --git a/Conductor/Api/WorkflowBulkResourceApi.cs b/Conductor/Api/WorkflowBulkResourceApi.cs index dd1622a6..6814f9b4 100644 --- a/Conductor/Api/WorkflowBulkResourceApi.cs +++ b/Conductor/Api/WorkflowBulkResourceApi.cs @@ -7,126 +7,6 @@ namespace Conductor.Api { - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IWorkflowBulkResourceApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Pause the list of workflows - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// BulkResponse - BulkResponse PauseWorkflow(List body); - - /// - /// Pause the list of workflows - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of BulkResponse - ApiResponse PauseWorkflowWithHttpInfo(List body); - /// - /// Restart the list of completed workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to false) - /// BulkResponse - BulkResponse Restart(List body, bool? useLatestDefinitions = null); - - /// - /// Restart the list of completed workflow - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional, default to false) - /// ApiResponse of BulkResponse - ApiResponse RestartWithHttpInfo(List body, bool? useLatestDefinitions = null); - /// - /// Resume the list of workflows - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// BulkResponse - BulkResponse ResumeWorkflow(List body); - - /// - /// Resume the list of workflows - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of BulkResponse - ApiResponse ResumeWorkflowWithHttpInfo(List body); - /// - /// Retry the last failed task for each workflow from the list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// BulkResponse - BulkResponse Retry(List body); - - /// - /// Retry the last failed task for each workflow from the list - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// ApiResponse of BulkResponse - ApiResponse RetryWithHttpInfo(List body); - /// - /// Terminate workflows execution - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional) - /// (optional, default to false) - /// BulkResponse - BulkResponse Terminate(List body, string reason = null, bool? triggerFailureWorkflow = null); - - /// - /// Terminate workflows execution - /// - /// - /// - /// - /// Thrown when fails to make API call - /// - /// (optional) - /// (optional, default to false) - /// ApiResponse of BulkResponse - ApiResponse TerminateWithHttpInfo(List body, string reason = null, bool? triggerFailureWorkflow = null); - #endregion Synchronous Operations - } - /// /// Represents a collection of functions to interact with the API endpoints /// diff --git a/Conductor/Api/WorkflowResourceApi.cs b/Conductor/Api/WorkflowResourceApi.cs index bf46ae56..66fc4ff6 100644 --- a/Conductor/Api/WorkflowResourceApi.cs +++ b/Conductor/Api/WorkflowResourceApi.cs @@ -333,7 +333,7 @@ public ApiResponse UpdateWorkflowVariablesWithHttpInfo(string workflow if (workflowId == null) throw new ApiException(400, "Missing required parameter 'workflowId' when calling WorkflowResourceApi->UpdateWorkflowVariables"); - + if (variables == null) throw new ApiException(400, "Missing required parameter 'variables' when calling WorkflowResourceApi->UpdateWorkflowVariables"); @@ -359,7 +359,7 @@ public ApiResponse UpdateWorkflowVariablesWithHttpInfo(string workflow String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - + localVarPostBody = this.Configuration.ApiClient.Serialize(variables); // authentication (api_key) required @@ -1101,7 +1101,7 @@ public ApiResponse PauseWorkflowWithHttpInfo(string workflowId) } - + /// @@ -2254,7 +2254,7 @@ public ApiResponse UploadCompletedWorkflowsWithHttpInfo() localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); } - + /// /// Update a workflow state by updating variables or in progress task Updates the workflow variables, tasks and triggers evaluation. /// @@ -2264,14 +2264,14 @@ public ApiResponse UploadCompletedWorkflowsWithHttpInfo() /// (optional) /// (optional, default to 10) /// WorkflowRun - public WorkflowRun UpdateWorkflow (string workflowId, WorkflowStateUpdate request, + public WorkflowRun UpdateWorkflow(string workflowId, WorkflowStateUpdate request, List waitUntilTaskRefs = null, int? waitForSeconds = null) { ApiResponse localVarResponse = UpdateWorkflowWithHttpInfo(workflowId, request, waitUntilTaskRefs, waitForSeconds); return localVarResponse.Data; } - - + + /// /// Update a workflow state by updating variables or in progress task Updates the workflow variables, tasks and triggers evaluation. /// @@ -2281,13 +2281,13 @@ public WorkflowRun UpdateWorkflow (string workflowId, WorkflowStateUpdate reques /// (optional) /// (optional, default to 10) /// ApiResponse of WorkflowRun - public ApiResponse< WorkflowRun > UpdateWorkflowWithHttpInfo (string workflowId, WorkflowStateUpdate request, + public ApiResponse UpdateWorkflowWithHttpInfo(string workflowId, WorkflowStateUpdate request, List waitUntilTaskRefs = null, int? waitForSeconds = null) { string requestId = Guid.NewGuid().ToString(); - string waitUntilTaskRef = waitUntilTaskRefs != null && waitUntilTaskRefs.Count > 0 ? + string waitUntilTaskRef = waitUntilTaskRefs != null && waitUntilTaskRefs.Count > 0 ? waitUntilTaskRefs.Aggregate((a, b) => a + ", " + b) : null; - + // verify the required parameter 'request' is set if (request == null) throw new ApiException(400, "Missing required parameter 'request' when calling WorkflowResourceApi->UpdateWorkflowAndTaskState"); @@ -2332,7 +2332,7 @@ public ApiResponse< WorkflowRun > UpdateWorkflowWithHttpInfo (string workflowId, { localVarPostBody = request; // byte array } - + // authentication (api_key) required if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) { @@ -2340,11 +2340,11 @@ public ApiResponse< WorkflowRun > UpdateWorkflowWithHttpInfo (string workflowId, } // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int) localVarResponse.StatusCode; + int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { @@ -2354,7 +2354,7 @@ public ApiResponse< WorkflowRun > UpdateWorkflowWithHttpInfo (string workflowId, return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (WorkflowRun) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(WorkflowRun))); + (WorkflowRun)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(WorkflowRun))); } public Workflow GetWorkflow(string workflowId, bool includeTasks) diff --git a/Conductor/Client/Models/StartWorkflowRequest.cs b/Conductor/Client/Models/StartWorkflowRequest.cs index 0d67d0c4..e19ae8e1 100644 --- a/Conductor/Client/Models/StartWorkflowRequest.cs +++ b/Conductor/Client/Models/StartWorkflowRequest.cs @@ -29,13 +29,13 @@ public partial class StartWorkflowRequest : IEquatable, IV /// workflowDef. /// idempotencyKey. /// idempotencyStrategy. - public StartWorkflowRequest(string correlationId = default(string), string createdBy = default(string), - string externalInputPayloadStoragePath = default(string), - Dictionary input = default(Dictionary), - string name = default(string), - int? priority = default(int?), - Dictionary taskToDomain = default(Dictionary), - int? version = default(int?), + public StartWorkflowRequest(string correlationId = default(string), string createdBy = default(string), + string externalInputPayloadStoragePath = default(string), + Dictionary input = default(Dictionary), + string name = default(string), + int? priority = default(int?), + Dictionary taskToDomain = default(Dictionary), + int? version = default(int?), WorkflowDef workflowDef = default(WorkflowDef), string idempotencyKey = default(string), IdempotencyStrategy idempotencyStrategy = IdempotencyStrategy.FAIL diff --git a/Conductor/Client/Models/WorkflowStateUpdate.cs b/Conductor/Client/Models/WorkflowStateUpdate.cs index f1f35424..275b3efe 100644 --- a/Conductor/Client/Models/WorkflowStateUpdate.cs +++ b/Conductor/Client/Models/WorkflowStateUpdate.cs @@ -12,7 +12,7 @@ namespace Conductor.Client.Models /// WorkflowStateUpdate /// [DataContract] - public partial class WorkflowStateUpdate : IEquatable, IValidatableObject + public partial class WorkflowStateUpdate : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -20,29 +20,31 @@ public partial class WorkflowStateUpdate : IEquatable, IVa /// taskReferenceName. /// taskResult. /// variables. - public WorkflowStateUpdate(string taskReferenceName = default(string), TaskResult taskResult = default(TaskResult), Dictionary variables = default(Dictionary)) + public WorkflowStateUpdate(string taskReferenceName = default(string), + TaskResult taskResult = default(TaskResult), + Dictionary variables = default(Dictionary)) { this.TaskReferenceName = taskReferenceName; this.TaskResult = taskResult; this.Variables = variables; } - + /// /// Gets or Sets TaskReferenceName /// - [DataMember(Name="taskReferenceName", EmitDefaultValue=false)] + [DataMember(Name = "taskReferenceName", EmitDefaultValue = false)] public string TaskReferenceName { get; set; } /// /// Gets or Sets TaskResult /// - [DataMember(Name="taskResult", EmitDefaultValue=false)] + [DataMember(Name = "taskResult", EmitDefaultValue = false)] public TaskResult TaskResult { get; set; } /// /// Gets or Sets Variables /// - [DataMember(Name="variables", EmitDefaultValue=false)] + [DataMember(Name = "variables", EmitDefaultValue = false)] public Dictionary Variables { get; set; } /// @@ -59,7 +61,7 @@ public override string ToString() sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -89,17 +91,17 @@ public bool Equals(WorkflowStateUpdate input) if (input == null) return false; - return + return ( this.TaskReferenceName == input.TaskReferenceName || (this.TaskReferenceName != null && - this.TaskReferenceName.Equals(input.TaskReferenceName)) - ) && + this.TaskReferenceName.Equals(input.TaskReferenceName)) + ) && ( this.TaskResult == input.TaskResult || (this.TaskResult != null && - this.TaskResult.Equals(input.TaskResult)) - ) && + this.TaskResult.Equals(input.TaskResult)) + ) && ( this.Variables == input.Variables || this.Variables != null && @@ -132,7 +134,8 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } diff --git a/Conductor/conductor-csharp.csproj b/Conductor/conductor-csharp.csproj index 7bc9dfa8..b7c25d96 100644 --- a/Conductor/conductor-csharp.csproj +++ b/Conductor/conductor-csharp.csproj @@ -1,22 +1,22 @@  - - netstandard2.0 - - https://github.com/conductor-sdk/conductor-csharp - C# sdk for conductor - README.md - - - - - - - - - - - - - - + + netstandard2.0 + + https://github.com/conductor-sdk/conductor-csharp + C# sdk for conductor + README.md + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tests/Api/WorkflowResourceApiTest.cs b/Tests/Api/WorkflowResourceApiTest.cs index c53af19d..8f989ba9 100644 --- a/Tests/Api/WorkflowResourceApiTest.cs +++ b/Tests/Api/WorkflowResourceApiTest.cs @@ -1,345 +1,343 @@ -using conductor.csharp.Client.Extensions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; using Conductor.Api; +using Conductor.Client; using Conductor.Client.Extensions; using Conductor.Client.Models; +using conductor.csharp.Client.Extensions; using Conductor.Definition; using Conductor.Definition.TaskType; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Conductor.Client; using Microsoft.Extensions.Logging; using Tests.Worker; using Xunit; using Xunit.Abstractions; using Task = Conductor.Client.Models.Task; -namespace conductor_csharp.test.Api +namespace conductor_csharp.test.Api; + +public class WorkflowResourceApiTest { - public class WorkflowResourceApiTest + private const string WORKFLOW_NAME = "TestToCreateVariables"; + private const string TASK_NAME = "TestToCreateVariables_Task"; + private const string WORKFLOW_VARIABLE_1 = "TestVariable1"; + private const string WORKFLOW_VARIABLE_2 = "TestVariable2"; + private const string WORKFLOW_DESC = "Test Workflow With Variables"; + private const int WORKFLOW_VERSION = 1; + private readonly ILogger _logger; + private readonly ITaskResourceApi _taskClient; + private readonly ITestOutputHelper _testOutputHelper; + + private readonly WorkflowResourceApi _workflowClient; + + public WorkflowResourceApiTest(ITestOutputHelper testOutputHelper) { - private readonly ITestOutputHelper _testOutputHelper; - private const string WORKFLOW_NAME = "TestToCreateVariables"; - private const string TASK_NAME = "TestToCreateVariables_Task"; - private const string WORKFLOW_VARIABLE_1 = "TestVariable1"; - private const string WORKFLOW_VARIABLE_2 = "TestVariable2"; - private const string WORKFLOW_DESC = "Test Workflow With Variables"; - private const int WORKFLOW_VERSION = 1; - - private readonly WorkflowResourceApi _workflowClient; - private readonly ITaskResourceApi _taskClient; - private readonly ILogger _logger; - - public WorkflowResourceApiTest(ITestOutputHelper testOutputHelper) - { - _testOutputHelper = testOutputHelper; - _workflowClient = ApiExtensions.GetClient(); - _taskClient = ApiExtensions.GetClient(); - _logger = ApplicationLogging.CreateLogger(); - } + _testOutputHelper = testOutputHelper; + _workflowClient = ApiExtensions.GetClient(); + _taskClient = ApiExtensions.GetClient(); + _logger = ApplicationLogging.CreateLogger(); + } - [Fact] - public void TestWorkflowOperations() + [Fact] + public void TestWorkflowOperations() + { + // Start Workflow + var correlationId = Guid.NewGuid().ToString(); + var startWorkflowRequest = new StartWorkflowRequest { - // Start Workflow - var correlationId = Guid.NewGuid().ToString(); - var startWorkflowRequest = new StartWorkflowRequest - { - Name = "csharp_sync_task_variable_updates", - Version = 1, - Input = new Dictionary(), - CorrelationId = correlationId - }; - var workflowId = _workflowClient.StartWorkflow(startWorkflowRequest); - _testOutputHelper.WriteLine($"Started workflow with id {workflowId}"); - - // Update a variable inside the workflow - _workflowClient.UpdateWorkflowVariables(workflowId, new Dictionary { { "case", "case1" } }); - - // Get workflow execution status - Workflow workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); - Task lastTask = workflow.Tasks.Last(); - _testOutputHelper.WriteLine( - $"Workflow status is {workflow.Status} and currently running task is {lastTask.ReferenceTaskName}"); - - workflow = _taskClient.UpdateTaskSync(new Dictionary { { "a", "b" } }, workflowId, lastTask.ReferenceTaskName, TaskResult.StatusEnum.COMPLETED, "test_worker"); - - // Get updated workflow status - lastTask = workflow.Tasks.Last(); - Assert.Equal(lastTask.Status, Task.StatusEnum.INPROGRESS); - _testOutputHelper.WriteLine( - $"Workflow status is {workflow.Status} and currently running task is {lastTask.ReferenceTaskName}"); - - // Terminate the workflow - _workflowClient.Terminate(workflowId, reason: "testing termination"); - workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); - Assert.Equal(Workflow.StatusEnum.TERMINATED, workflow.Status); - lastTask = workflow.Tasks.Last(); - _testOutputHelper.WriteLine( - $"Workflow status is {workflow.Status} and status of last task {lastTask.Status}"); - - // Retry the workflow - _workflowClient.Retry(workflowId); - workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); - Assert.Equal(Workflow.StatusEnum.RUNNING, workflow.Status); - lastTask = workflow.Tasks.Last(); - _testOutputHelper.WriteLine( - $"Workflow status is {workflow.Status} and status of last task {lastTask.ReferenceTaskName} is {lastTask.Status}"); - - // Mark the WAIT task as completed by calling Task completion API - TaskResult taskResult = new TaskResult - { - WorkflowInstanceId = workflowId, - TaskId = lastTask.TaskId, - Status = TaskResult.StatusEnum.COMPLETED, - OutputData = new Dictionary { { "greetings", "hello from Orkes" } } - }; - workflow = _taskClient.UpdateTaskSync(new Dictionary { { "greetings", "hello from Orkes" } }, - workflowId, lastTask.ReferenceTaskName, TaskResult.StatusEnum.COMPLETED, ""); - - lastTask = workflow.Tasks.Last(); - Assert.Equal(Task.StatusEnum.SCHEDULED, lastTask.Status); - _testOutputHelper.WriteLine( - $"Workflow status is {workflow.Status} and status of last task {lastTask.ReferenceTaskName} is {lastTask.Status}"); - - // Terminate the workflow again - _workflowClient.Terminate(workflowId, reason: "terminating for testing"); - workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); - Assert.Equal(Workflow.StatusEnum.TERMINATED, workflow.Status); - - - // Rerun workflow from a specific task - RerunWorkflowRequest rerunRequest = new RerunWorkflowRequest - { - ReRunFromTaskId = workflow.Tasks[3].TaskId - }; - _workflowClient.Rerun(rerunRequest, workflowId); - workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); - Assert.Equal(Workflow.StatusEnum.RUNNING, workflow.Status); - - - // Restart the workflow - _workflowClient.Terminate(workflowId, reason: "terminating so we can do a restart"); - workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); - Assert.Equal(Workflow.StatusEnum.TERMINATED, workflow.Status); - - _workflowClient.Restart(workflowId); - workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); - Assert.Equal(Workflow.StatusEnum.RUNNING, workflow.Status); - - // Pause the workflow - _workflowClient.PauseWorkflow(workflowId); - workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); - Assert.Equal(Workflow.StatusEnum.PAUSED, workflow.Status); - _testOutputHelper.WriteLine($"Workflow status is {workflow.Status}"); - - workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); - // Wait task should have completed - Task waitTask = workflow.Tasks[0]; - Assert.Equal(Task.StatusEnum.INPROGRESS, waitTask.Status); - _testOutputHelper.WriteLine($"Workflow status is {workflow.Status} and wait task is {waitTask.Status}"); - - - // Because workflow is paused, no further task should have been scheduled, making WAIT the last task - // Expecting only 1 task - _testOutputHelper.WriteLine($"Number of tasks in workflow is {workflow.Tasks.Count}"); - Assert.Single(workflow.Tasks); - - // Resume the workflow - _workflowClient.ResumeWorkflow(workflowId); - lastTask = workflow.Tasks.Last(); - workflow = _taskClient.UpdateTaskSync(new Dictionary { { "a", "b" } }, workflowId, lastTask.ReferenceTaskName, TaskResult.StatusEnum.COMPLETED, "test_worker"); - - workflow = _workflowClient.GetWorkflow(workflowId, includeTasks: true); - - // There should be 3 tasks - _testOutputHelper.WriteLine( - $"Number of tasks in workflow is {workflow.Tasks.Count} and last task is {workflow.Tasks.Last().ReferenceTaskName}"); - Assert.Equal(3, workflow.Tasks.Count); - - // Search for workflows - var searchResults = _workflowClient.Search(start: 0, size: 100, freeText: "*", - query: $"correlationId = '{correlationId}'"); - _testOutputHelper.WriteLine( - $"Found {searchResults.Results.Count} execution with correlation_id '{correlationId}'"); - Assert.Single(searchResults.Results); - - correlationId = Guid.NewGuid().ToString(); - searchResults = _workflowClient.Search(start: 0, size: 100, freeText: "*", - query: $"status IN (RUNNING) AND correlationId = \"{correlationId}\""); - // Shouldn't find anything! - _testOutputHelper.WriteLine( - $"Found {searchResults.Results.Count} workflows with correlation id {correlationId}"); - } - - [Fact] - public async void UpdateWorkflowVariables() + Name = "csharp_sync_task_variable_updates", + Version = 1, + Input = new Dictionary(), + CorrelationId = correlationId + }; + var workflowId = _workflowClient.StartWorkflow(startWorkflowRequest); + _testOutputHelper.WriteLine($"Started workflow with id {workflowId}"); + + // Update a variable inside the workflow + _workflowClient.UpdateWorkflowVariables(workflowId, new Dictionary { { "case", "case1" } }); + + // Get workflow execution status + var workflow = _workflowClient.GetWorkflow(workflowId, true); + var lastTask = workflow.Tasks.Last(); + _testOutputHelper.WriteLine( + $"Workflow status is {workflow.Status} and currently running task is {lastTask.ReferenceTaskName}"); + + workflow = _taskClient.UpdateTaskSync(new Dictionary { { "a", "b" } }, workflowId, + lastTask.ReferenceTaskName, TaskResult.StatusEnum.COMPLETED, "test_worker"); + + // Get updated workflow status + lastTask = workflow.Tasks.Last(); + Assert.Equal(lastTask.Status, Task.StatusEnum.INPROGRESS); + _testOutputHelper.WriteLine( + $"Workflow status is {workflow.Status} and currently running task is {lastTask.ReferenceTaskName}"); + + // Terminate the workflow + _workflowClient.Terminate(workflowId, "testing termination"); + workflow = _workflowClient.GetWorkflow(workflowId, true); + Assert.Equal(Workflow.StatusEnum.TERMINATED, workflow.Status); + lastTask = workflow.Tasks.Last(); + _testOutputHelper.WriteLine( + $"Workflow status is {workflow.Status} and status of last task {lastTask.Status}"); + + // Retry the workflow + _workflowClient.Retry(workflowId); + workflow = _workflowClient.GetWorkflow(workflowId, true); + Assert.Equal(Workflow.StatusEnum.RUNNING, workflow.Status); + lastTask = workflow.Tasks.Last(); + _testOutputHelper.WriteLine( + $"Workflow status is {workflow.Status} and status of last task {lastTask.ReferenceTaskName} is {lastTask.Status}"); + + // Mark the WAIT task as completed by calling Task completion API + var taskResult = new TaskResult + { + WorkflowInstanceId = workflowId, + TaskId = lastTask.TaskId, + Status = TaskResult.StatusEnum.COMPLETED, + OutputData = new Dictionary { { "greetings", "hello from Orkes" } } + }; + workflow = _taskClient.UpdateTaskSync( + new Dictionary { { "greetings", "hello from Orkes" } }, + workflowId, lastTask.ReferenceTaskName, TaskResult.StatusEnum.COMPLETED, ""); + + lastTask = workflow.Tasks.Last(); + Assert.Equal(Task.StatusEnum.SCHEDULED, lastTask.Status); + _testOutputHelper.WriteLine( + $"Workflow status is {workflow.Status} and status of last task {lastTask.ReferenceTaskName} is {lastTask.Status}"); + + // Terminate the workflow again + _workflowClient.Terminate(workflowId, "terminating for testing"); + workflow = _workflowClient.GetWorkflow(workflowId, true); + Assert.Equal(Workflow.StatusEnum.TERMINATED, workflow.Status); + + + // Rerun workflow from a specific task + var rerunRequest = new RerunWorkflowRequest { - // Prepare workflow - var _workflow = GetConductorWorkflow(); - ApiExtensions.GetWorkflowExecutor().RegisterWorkflow(_workflow, true); - var workflowId = ApiExtensions.GetWorkflowExecutor().StartWorkflow(_workflow); + ReRunFromTaskId = workflow.Tasks[3].TaskId + }; + _workflowClient.Rerun(rerunRequest, workflowId); + workflow = _workflowClient.GetWorkflow(workflowId, true); + Assert.Equal(Workflow.StatusEnum.RUNNING, workflow.Status); + + + // Restart the workflow + _workflowClient.Terminate(workflowId, "terminating so we can do a restart"); + workflow = _workflowClient.GetWorkflow(workflowId, true); + Assert.Equal(Workflow.StatusEnum.TERMINATED, workflow.Status); + + _workflowClient.Restart(workflowId); + workflow = _workflowClient.GetWorkflow(workflowId, true); + Assert.Equal(Workflow.StatusEnum.RUNNING, workflow.Status); + + // Pause the workflow + _workflowClient.PauseWorkflow(workflowId); + workflow = _workflowClient.GetWorkflow(workflowId, true); + Assert.Equal(Workflow.StatusEnum.PAUSED, workflow.Status); + _testOutputHelper.WriteLine($"Workflow status is {workflow.Status}"); + + workflow = _workflowClient.GetWorkflow(workflowId, true); + // Wait task should have completed + var waitTask = workflow.Tasks[0]; + Assert.Equal(Task.StatusEnum.INPROGRESS, waitTask.Status); + _testOutputHelper.WriteLine($"Workflow status is {workflow.Status} and wait task is {waitTask.Status}"); + + + // Because workflow is paused, no further task should have been scheduled, making WAIT the last task + // Expecting only 1 task + _testOutputHelper.WriteLine($"Number of tasks in workflow is {workflow.Tasks.Count}"); + Assert.Single(workflow.Tasks); + + // Resume the workflow + _workflowClient.ResumeWorkflow(workflowId); + lastTask = workflow.Tasks.Last(); + workflow = _taskClient.UpdateTaskSync(new Dictionary { { "a", "b" } }, workflowId, + lastTask.ReferenceTaskName, TaskResult.StatusEnum.COMPLETED, "test_worker"); + + workflow = _workflowClient.GetWorkflow(workflowId, true); + + // There should be 3 tasks + _testOutputHelper.WriteLine( + $"Number of tasks in workflow is {workflow.Tasks.Count} and last task is {workflow.Tasks.Last().ReferenceTaskName}"); + Assert.Equal(3, workflow.Tasks.Count); + + // Search for workflows + var searchResults = _workflowClient.Search(start: 0, size: 100, freeText: "*", + query: $"correlationId = '{correlationId}'"); + _testOutputHelper.WriteLine( + $"Found {searchResults.Results.Count} execution with correlation_id '{correlationId}'"); + Assert.Single(searchResults.Results); + + correlationId = Guid.NewGuid().ToString(); + searchResults = _workflowClient.Search(start: 0, size: 100, freeText: "*", + query: $"status IN (RUNNING) AND correlationId = \"{correlationId}\""); + // Shouldn't find anything! + _testOutputHelper.WriteLine( + $"Found {searchResults.Results.Count} workflows with correlation id {correlationId}"); + } - // Create variables collection with values to be updated - var updateDict = new Dictionary - { - { WORKFLOW_VARIABLE_1, "Value1" }, - { WORKFLOW_VARIABLE_2, "Value2" }, - }; - - // Update the work flow variables - _workflowClient.UpdateWorkflowVariables(workflowId, updateDict); - // Fetch latest workflow data to validate the change in variables - var _updatedWorkFlow = _workflowClient.GetWorkflowStatusSummary(workflowId, includeVariables: true); - // Verify workflow variables data is equal with input passed - Assert.Equal(_updatedWorkFlow.Variables, updateDict); - } + [Fact] + public async void UpdateWorkflowVariables() + { + // Prepare workflow + var _workflow = GetConductorWorkflow(); + ApiExtensions.GetWorkflowExecutor().RegisterWorkflow(_workflow, true); + var workflowId = ApiExtensions.GetWorkflowExecutor().StartWorkflow(_workflow); - [Fact] - public void TestUpdateWorkflowState() + // Create variables collection with values to be updated + var updateDict = new Dictionary { - var startWorkflowRequest = new StartWorkflowRequest - { - Name = "csharp_sync_task_variable_updates", - Version = 1, - Input = new Dictionary() - }; - var workflowRun = _workflowClient.ExecuteWorkflow(startWorkflowRequest, - Guid.NewGuid().ToString(), - startWorkflowRequest.Name, startWorkflowRequest.Version, - "wait_task_ref"); - - var workflowId = workflowRun.WorkflowId; - _testOutputHelper.WriteLine(workflowId); - - TaskResult taskResult = new TaskResult - { - OutputData = new Dictionary { { "a", "b" } } - }; + { WORKFLOW_VARIABLE_1, "Value1" }, + { WORKFLOW_VARIABLE_2, "Value2" } + }; + + // Update the work flow variables + _workflowClient.UpdateWorkflowVariables(workflowId, updateDict); + // Fetch latest workflow data to validate the change in variables + var _updatedWorkFlow = _workflowClient.GetWorkflowStatusSummary(workflowId, includeVariables: true); + // Verify workflow variables data is equal with input passed + Assert.Equal(_updatedWorkFlow.Variables, updateDict); + } - WorkflowStateUpdate request = new WorkflowStateUpdate - { - TaskReferenceName = "wait_task_ref", - TaskResult = taskResult, - Variables = new Dictionary { { "case", "case1" } } - }; + [Fact] + public void TestUpdateWorkflowState() + { + var startWorkflowRequest = new StartWorkflowRequest + { + Name = "csharp_sync_task_variable_updates", + Version = 1, + Input = new Dictionary() + }; + var workflowRun = _workflowClient.ExecuteWorkflow(startWorkflowRequest, + Guid.NewGuid().ToString(), + startWorkflowRequest.Name, startWorkflowRequest.Version, + "wait_task_ref"); + + var workflowId = workflowRun.WorkflowId; + _testOutputHelper.WriteLine(workflowId); + + var taskResult = new TaskResult + { + OutputData = new Dictionary { { "a", "b" } } + }; - workflowRun = _workflowClient.UpdateWorkflow(workflowId, request, - new List { "wait_task_ref_1", "wait_task_ref_2" }, 10); + var request = new WorkflowStateUpdate + { + TaskReferenceName = "wait_task_ref", + TaskResult = taskResult, + Variables = new Dictionary { { "case", "case1" } } + }; - _testOutputHelper.WriteLine(workflowRun.ToString()); - _testOutputHelper.WriteLine(workflowRun.Status.ToString()); - _testOutputHelper.WriteLine(workflowRun.Tasks - .Select(task => $"{task.ReferenceTaskName}:{task.Status}") - .ToList().ToString()); + workflowRun = _workflowClient.UpdateWorkflow(workflowId, request, + new List { "wait_task_ref_1", "wait_task_ref_2" }, 10); - request = new WorkflowStateUpdate - { - TaskReferenceName = "wait_task_ref_2", - TaskResult = taskResult - }; - - workflowRun = _workflowClient.UpdateWorkflow(workflowId, request, new List(), 2); - Assert.Equal(WorkflowStatus.StatusEnum.RUNNING.ToString(), workflowRun.Status.ToString()); - - request = new WorkflowStateUpdate - { - TaskReferenceName = "simple_task_ref", - TaskResult = taskResult - }; - workflowRun = _workflowClient.UpdateWorkflow(workflowId, request, new List(), 2); - - var allTaskStatus = workflowRun.Tasks - .Select(t => t.Status) - .ToHashSet(); - - Assert.Single(allTaskStatus); - Assert.Equal(Task.StatusEnum.COMPLETED.ToString(), allTaskStatus.First().ToString()); - - _testOutputHelper.WriteLine(workflowRun.Status.ToString()); - _testOutputHelper.WriteLine(workflowRun.Tasks - .Select(task => $"{task.ReferenceTaskName}:{task.Status}") - .ToList().ToString()); - } + _testOutputHelper.WriteLine(workflowRun.ToString()); + _testOutputHelper.WriteLine(workflowRun.Status.ToString()); + _testOutputHelper.WriteLine(workflowRun.Tasks + .Select(task => $"{task.ReferenceTaskName}:{task.Status}") + .ToList().ToString()); + + request = new WorkflowStateUpdate + { + TaskReferenceName = "wait_task_ref_2", + TaskResult = taskResult + }; + workflowRun = _workflowClient.UpdateWorkflow(workflowId, request, new List(), 2); + Assert.Equal(WorkflowStatus.StatusEnum.RUNNING.ToString(), workflowRun.Status.ToString()); - [Fact] - public void TestStartWorkflowConflict() + request = new WorkflowStateUpdate { - var startWorkflowRequest = new StartWorkflowRequest - { - Name = "csharp_sync_task_variable_updates", - Version = 1 - }; + TaskReferenceName = "simple_task_ref", + TaskResult = taskResult + }; + workflowRun = _workflowClient.UpdateWorkflow(workflowId, request, new List(), 2); + + var allTaskStatus = workflowRun.Tasks + .Select(t => t.Status) + .ToHashSet(); + + Assert.Single(allTaskStatus); + Assert.Equal(Task.StatusEnum.COMPLETED.ToString(), allTaskStatus.First().ToString()); + + _testOutputHelper.WriteLine(workflowRun.Status.ToString()); + _testOutputHelper.WriteLine(workflowRun.Tasks + .Select(task => $"{task.ReferenceTaskName}:{task.Status}") + .ToList().ToString()); + } - string idempotencyKey = Guid.NewGuid().ToString(); - startWorkflowRequest.IdempotencyKey = idempotencyKey; - startWorkflowRequest.IdempotencyStrategy = IdempotencyStrategy.FAIL; - string workflowId = _workflowClient.StartWorkflow(startWorkflowRequest); - _testOutputHelper.WriteLine(workflowId); + [Fact] + public void TestStartWorkflowConflict() + { + var startWorkflowRequest = new StartWorkflowRequest + { + Name = "csharp_sync_task_variable_updates", + Version = 1 + }; - startWorkflowRequest.IdempotencyStrategy = IdempotencyStrategy.RETURN_EXISTING; - string workflowId2 = _workflowClient.StartWorkflow(startWorkflowRequest); - Assert.Equal(workflowId, workflowId2); + var idempotencyKey = Guid.NewGuid().ToString(); + startWorkflowRequest.IdempotencyKey = idempotencyKey; + startWorkflowRequest.IdempotencyStrategy = IdempotencyStrategy.FAIL; - startWorkflowRequest.IdempotencyStrategy = IdempotencyStrategy.FAIL; - bool conflict = false; + var workflowId = _workflowClient.StartWorkflow(startWorkflowRequest); + _testOutputHelper.WriteLine(workflowId); - try - { - _workflowClient.StartWorkflow(startWorkflowRequest); - } - catch (ApiException ce) - { - if (ce.ErrorCode == 409) - { - conflict = true; - } - } + startWorkflowRequest.IdempotencyStrategy = IdempotencyStrategy.RETURN_EXISTING; + var workflowId2 = _workflowClient.StartWorkflow(startWorkflowRequest); + Assert.Equal(workflowId, workflowId2); - Assert.True(conflict); - } + startWorkflowRequest.IdempotencyStrategy = IdempotencyStrategy.FAIL; + var conflict = false; - private async System.Threading.Tasks.Task ExecuteWorkflowTasks(TimeSpan workflowCompletionTimeout) + try { - var host = WorkflowTaskHost.CreateWorkerHost(LogLevel.Information, - new ClassWorker(taskType: "TestToCreateVariables_Task")); - await host.StartAsync(); - Thread.Sleep(workflowCompletionTimeout); - await host.StopAsync(); + _workflowClient.StartWorkflow(startWorkflowRequest); } - - private ConductorWorkflow GetConductorWorkflow() + catch (ApiException ce) { - return new ConductorWorkflow() - .WithName(WORKFLOW_NAME) - .WithVersion(WORKFLOW_VERSION) - .WithDescription(WORKFLOW_DESC) - .WithTask(new SimpleTask(TASK_NAME, TASK_NAME)) - .WithVariable(WORKFLOW_VARIABLE_1, $"{WORKFLOW_VARIABLE_1}_Value") - .WithVariable(WORKFLOW_VARIABLE_2, $"{WORKFLOW_VARIABLE_2}_Value"); + if (ce.ErrorCode == 409) conflict = true; } - private async System.Threading.Tasks.Task ValidateWorkflowCompletion(params string[] workflowIdList) + Assert.True(conflict); + } + + private async System.Threading.Tasks.Task ExecuteWorkflowTasks(TimeSpan workflowCompletionTimeout) + { + var host = WorkflowTaskHost.CreateWorkerHost(LogLevel.Information, + new ClassWorker("TestToCreateVariables_Task")); + await host.StartAsync(); + Thread.Sleep(workflowCompletionTimeout); + await host.StopAsync(); + } + + private ConductorWorkflow GetConductorWorkflow() + { + return new ConductorWorkflow() + .WithName(WORKFLOW_NAME) + .WithVersion(WORKFLOW_VERSION) + .WithDescription(WORKFLOW_DESC) + .WithTask(new SimpleTask(TASK_NAME, TASK_NAME)) + .WithVariable(WORKFLOW_VARIABLE_1, $"{WORKFLOW_VARIABLE_1}_Value") + .WithVariable(WORKFLOW_VARIABLE_2, $"{WORKFLOW_VARIABLE_2}_Value"); + } + + private async System.Threading.Tasks.Task ValidateWorkflowCompletion(params string[] workflowIdList) + { + var workflowStatusList = await WorkflowExtensions.GetWorkflowStatusList( + _workflowClient, + 10, + workflowIdList + ); + var incompleteWorkflowCounter = 0; + workflowStatusList.ToList().ForEach(wf => { - var workflowStatusList = await WorkflowExtensions.GetWorkflowStatusList( - _workflowClient, - maxAllowedInParallel: 10, - workflowIdList - ); - var incompleteWorkflowCounter = 0; - workflowStatusList.ToList().ForEach(wf => + if (wf.Status.Value != WorkflowStatus.StatusEnum.COMPLETED) { - if (wf.Status.Value != WorkflowStatus.StatusEnum.COMPLETED) - { - incompleteWorkflowCounter += 1; - _logger.LogInformation($"Workflow not completed, workflowId: {wf.WorkflowId}"); - } - }); - Assert.Equal(0, incompleteWorkflowCounter); - } + incompleteWorkflowCounter += 1; + _logger.LogInformation($"Workflow not completed, workflowId: {wf.WorkflowId}"); + } + }); + Assert.Equal(0, incompleteWorkflowCounter); } } \ No newline at end of file diff --git a/Tests/Client/OrkesApiClientTest.cs b/Tests/Client/OrkesApiClientTest.cs index 2aee3e63..971d4122 100644 --- a/Tests/Client/OrkesApiClientTest.cs +++ b/Tests/Client/OrkesApiClientTest.cs @@ -3,20 +3,19 @@ using Conductor.Client.Extensions; using Xunit; -namespace Tests.Client +namespace Tests.Client; + +public class OrkesApiClientTest { - public class OrkesApiClientTest + [Fact] + public void TestOrkesApiClient() { - [Fact] - public void TestOrkesApiClient() - { - var configuration = ApiExtensions.GetConfiguration(); - var orkesApiClient = new OrkesApiClient(configuration, null); - var workflowClient = orkesApiClient.GetClient(); - var expectedWorkflowClient = configuration.GetClient(); - var token = workflowClient.Configuration.AccessToken; - var expectedToken = expectedWorkflowClient.Configuration.AccessToken; - Assert.Equal(expectedToken, token); - } + var configuration = ApiExtensions.GetConfiguration(); + var orkesApiClient = new OrkesApiClient(configuration, null); + var workflowClient = orkesApiClient.GetClient(); + var expectedWorkflowClient = configuration.GetClient(); + var token = workflowClient.Configuration.AccessToken; + var expectedToken = expectedWorkflowClient.Configuration.AccessToken; + Assert.Equal(expectedToken, token); } } \ No newline at end of file diff --git a/Tests/Definition/WorkflowDefinitionTests.cs b/Tests/Definition/WorkflowDefinitionTests.cs index 4feaec69..55cffa21 100644 --- a/Tests/Definition/WorkflowDefinitionTests.cs +++ b/Tests/Definition/WorkflowDefinitionTests.cs @@ -1,187 +1,186 @@ +using System; +using System.Threading; +using Conductor.Client; using Conductor.Client.Extensions; using Conductor.Client.Models; using Conductor.Definition; using Conductor.Definition.TaskType; using Conductor.Executor; -using System; using Xunit; -namespace Tests.Definition +namespace Tests.Definition; + +public class WorkflowDefTests { - public class WorkflowDefTests - { - private const string WORKFLOW_NAME = "test-sdk-csharp-workflow"; - private const int WORKFLOW_VERSION = 1; - private const string WORKFLOW_DESCRIPTION = "Test SDK C# Workflow"; - private const string WORKFLOW_OWNER_EMAIL = "test@test"; - private const string WORKFLOW_INPUT_PARAMETER = "number"; - private const string TASK_NAME = "test-sdk-csharp-task"; + private const string WORKFLOW_NAME = "test-sdk-csharp-workflow"; + private const int WORKFLOW_VERSION = 1; + private const string WORKFLOW_DESCRIPTION = "Test SDK C# Workflow"; + private const string WORKFLOW_OWNER_EMAIL = "test@test"; + private const string WORKFLOW_INPUT_PARAMETER = "number"; + private const string TASK_NAME = "test-sdk-csharp-task"; - private WorkflowExecutor _workflowExecutor = null; + private readonly WorkflowExecutor _workflowExecutor; - public WorkflowDefTests() - { - _workflowExecutor = ApiExtensions.GetWorkflowExecutor(); - } + public WorkflowDefTests() + { + _workflowExecutor = ApiExtensions.GetWorkflowExecutor(); + } - [Fact] - public void TestKitchenSinkWorkflow() - { - for (int i = 0; i < 3; i += 1) + [Fact] + public void TestKitchenSinkWorkflow() + { + for (var i = 0; i < 3; i += 1) + try { - try - { - _workflowExecutor.RegisterWorkflow( - workflow: GetConductorWorkflow(), - overwrite: true - ); - return; - } - catch (Conductor.Client.ApiException) - { - System.Threading.Thread.Sleep(TimeSpan.FromSeconds(1 << i)); - } + _workflowExecutor.RegisterWorkflow( + GetConductorWorkflow(), + true + ); + return; + } + catch (ApiException) + { + Thread.Sleep(TimeSpan.FromSeconds(1 << i)); } - } + } - private ConductorWorkflow GetConductorWorkflow() - { - return new ConductorWorkflow() + private ConductorWorkflow GetConductorWorkflow() + { + return new ConductorWorkflow() .WithName(WORKFLOW_NAME) .WithVersion(WORKFLOW_VERSION) .WithDescription(WORKFLOW_DESCRIPTION) .WithInputParameter(WORKFLOW_INPUT_PARAMETER) .WithOwner(WORKFLOW_OWNER_EMAIL) - .WithTask(GetSimpleTask()) - .WithTask(GetSubWorkflowTask()) - .WithTask(GetHttpTask()) - .WithTask(GetForkJoinTask()) - .WithTask(GetJavascriptTask()) - .WithTask(GetDoWhileTask()) - .WithTask(GetEventTask()) - .WithTask(GetJQTask()) - .WithTask(GetSwitchTask()) - .WithTask(GetWaitTask()) - .WithTask(GetSetVariableTask()) - .WithTask(GetTerminateTask()) + .WithTask(GetSimpleTask()) + .WithTask(GetSubWorkflowTask()) + .WithTask(GetHttpTask()) + .WithTask(GetForkJoinTask()) + .WithTask(GetJavascriptTask()) + .WithTask(GetDoWhileTask()) + .WithTask(GetEventTask()) + .WithTask(GetJQTask()) + .WithTask(GetSwitchTask()) + .WithTask(GetWaitTask()) + .WithTask(GetSetVariableTask()) + .WithTask(GetTerminateTask()) ; - } + } - private WorkflowTask GetSimpleTask(string taskReferenceName = TASK_NAME) - { - return new SimpleTask(taskReferenceName, taskReferenceName); - } + private WorkflowTask GetSimpleTask(string taskReferenceName = TASK_NAME) + { + return new SimpleTask(taskReferenceName, taskReferenceName); + } - private WorkflowTask GetHttpTask(string taskReferenceName = "http_task_reference_name") - { - HttpTaskSettings settings = new HttpTaskSettings(); - settings.uri = "https://jsonplaceholder.typicode.com/posts/${workflow.input.queryid}"; - return new HttpTask(taskReferenceName, settings); - } + private WorkflowTask GetHttpTask(string taskReferenceName = "http_task_reference_name") + { + var settings = new HttpTaskSettings(); + settings.uri = "https://jsonplaceholder.typicode.com/posts/${workflow.input.queryid}"; + return new HttpTask(taskReferenceName, settings); + } - private WorkflowTask GetEventTask(string taskReferenceName = "event_task_reference_name") - { - return new EventTask(taskReferenceName, "event_sink_name"); - } + private WorkflowTask GetEventTask(string taskReferenceName = "event_task_reference_name") + { + return new EventTask(taskReferenceName, "event_sink_name"); + } - private WorkflowTask GetJQTask(string taskReferenceName = "jq_task_reference_name") - { - return new JQTask(taskReferenceName, "{ key3: (.key1.value1 + .key2.value2) }"); - } + private WorkflowTask GetJQTask(string taskReferenceName = "jq_task_reference_name") + { + return new JQTask(taskReferenceName, "{ key3: (.key1.value1 + .key2.value2) }"); + } - private WorkflowTask GetTerminateTask(string taskReferenceName = "terminate_task_reference_name") - { - return new TerminateTask(taskReferenceName); - } + private WorkflowTask GetTerminateTask(string taskReferenceName = "terminate_task_reference_name") + { + return new TerminateTask(taskReferenceName); + } - private WorkflowTask GetWaitTask(string taskReferenceName = "wait_task_reference_name") - { - return new WaitTask(taskReferenceName, new TimeSpan(1)); - } + private WorkflowTask GetWaitTask(string taskReferenceName = "wait_task_reference_name") + { + return new WaitTask(taskReferenceName, new TimeSpan(1)); + } - private WorkflowTask GetSetVariableTask(string taskReferenceName = "set_variable_task_reference_name") - { - return new SetVariableTask(taskReferenceName) - .WithInput("variable_name", "variable_content"); - } + private WorkflowTask GetSetVariableTask(string taskReferenceName = "set_variable_task_reference_name") + { + return new SetVariableTask(taskReferenceName) + .WithInput("variable_name", "variable_content"); + } - private WorkflowTask GetDoWhileTask(string taskReferenceName = "do_while_task_reference_name") - { - return new LoopTask + private WorkflowTask GetDoWhileTask(string taskReferenceName = "do_while_task_reference_name") + { + return new LoopTask + ( + taskReferenceName, + 5, + GetWaitTask("do_while_wait_inner_task_reference_name") + ); + } + + private WorkflowTask GetSubWorkflowTask(string taskReferenceName = "sub_workflow_task_reference_name") + { + return new SubWorkflowTask + ( + taskReferenceName, + new SubWorkflowParams ( - taskReferenceName: taskReferenceName, - iterations: 5, - GetWaitTask("do_while_wait_inner_task_reference_name") - ); - } + "test-sdk-java-workflow" + ) + ); + } - private WorkflowTask GetSubWorkflowTask(string taskReferenceName = "sub_workflow_task_reference_name") + private WorkflowTask[] GetForkJoinTask(string taskReferenceName = "fork_join_task_reference_name") + { + return new WorkflowTask[] { - return new SubWorkflowTask + new ForkJoinTask ( - taskReferenceName: taskReferenceName, - subWorkflowParams: new SubWorkflowParams - ( - name: "test-sdk-java-workflow" - ) - ); - } - - private WorkflowTask[] GetForkJoinTask(string taskReferenceName = "fork_join_task_reference_name") - { - return new WorkflowTask[] - { - new ForkJoinTask - ( - taskReferenceName: taskReferenceName, - new WorkflowTask[] - { - GetSetVariableTask("fork_join_set_variable_inner_task_reference_name"), - GetTerminateTask("fork_join_terminate_inner_task_reference_name") - }, - new WorkflowTask[] - { - GetWaitTask("fork_join_wait_inner_task_reference_name") - } - ), - new JoinTask - ( - taskReferenceName: taskReferenceName + "_join", + taskReferenceName, + new[] + { + GetSetVariableTask("fork_join_set_variable_inner_task_reference_name"), + GetTerminateTask("fork_join_terminate_inner_task_reference_name") + }, + new[] + { GetWaitTask("fork_join_wait_inner_task_reference_name") - ) - }; - } + } + ), + new JoinTask + ( + taskReferenceName + "_join", + GetWaitTask("fork_join_wait_inner_task_reference_name") + ) + }; + } - private WorkflowTask GetJavascriptTask(string taskReferenceName = "javascript_task_reference_name") - { - return new JavascriptTask( - taskReferenceName: taskReferenceName, - script: "{ key3: (.key1.value1 + .key2.value2) }" - ); - } + private WorkflowTask GetJavascriptTask(string taskReferenceName = "javascript_task_reference_name") + { + return new JavascriptTask( + taskReferenceName, + "{ key3: (.key1.value1 + .key2.value2) }" + ); + } - private WorkflowTask GetSwitchTask(string taskReferenceName = "switch_task_reference_name") - { - return new SwitchTask - ( - taskReferenceName: taskReferenceName, - caseExpression: "$.variable < 15 ? 'LONG':'LONG'", - useJavascript: true - ).WithDecisionCase - ( - key: "LONG", - GetWaitTask("switch_wait_inner_task_reference_name") - ).WithDecisionCase - ( - key: "SHORT", - GetTerminateTask("switch_terminate_inner_task_reference_name") - ).WithDefaultCase - ( - GetHttpTask("switch_http_inner_task_reference_name") - ).WithInput - ( - "variable", "${workflow.input." + WORKFLOW_INPUT_PARAMETER + "}" - ); - } + private WorkflowTask GetSwitchTask(string taskReferenceName = "switch_task_reference_name") + { + return new SwitchTask + ( + taskReferenceName, + "$.variable < 15 ? 'LONG':'LONG'", + true + ).WithDecisionCase + ( + "LONG", + GetWaitTask("switch_wait_inner_task_reference_name") + ).WithDecisionCase + ( + "SHORT", + GetTerminateTask("switch_terminate_inner_task_reference_name") + ).WithDefaultCase + ( + GetHttpTask("switch_http_inner_task_reference_name") + ).WithInput + ( + "variable", "${workflow.input." + WORKFLOW_INPUT_PARAMETER + "}" + ); } -} +} \ No newline at end of file diff --git a/Tests/Worker/WorkerTests.cs b/Tests/Worker/WorkerTests.cs index d1f77312..f19c1ca3 100644 --- a/Tests/Worker/WorkerTests.cs +++ b/Tests/Worker/WorkerTests.cs @@ -1,90 +1,90 @@ -using conductor.csharp.Client.Extensions; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; using Conductor.Api; using Conductor.Client.Extensions; using Conductor.Client.Models; +using conductor.csharp.Client.Extensions; using Conductor.Definition; using Conductor.Definition.TaskType; using Microsoft.Extensions.Logging; -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Threading; using Xunit; +using Task = System.Threading.Tasks.Task; + +namespace Tests.Worker; -namespace Tests.Worker +public class WorkerTests { - public class WorkerTests - { - private const string WORKFLOW_NAME = "test-sdk-csharp-worker"; - private const int WORKFLOW_VERSION = 1; - private const string TASK_NAME = "test-sdk-csharp-task"; - private const string TASK_DOMAIN = "taskDomain"; + private const string WORKFLOW_NAME = "test-sdk-csharp-worker"; + private const int WORKFLOW_VERSION = 1; + private const string TASK_NAME = "test-sdk-csharp-task"; + private const string TASK_DOMAIN = "taskDomain"; + private readonly ILogger _logger; - private readonly WorkflowResourceApi _workflowClient; - private readonly ILogger _logger; + private readonly WorkflowResourceApi _workflowClient; - public WorkerTests() - { - _workflowClient = ApiExtensions.GetClient(); - _logger = ApplicationLogging.CreateLogger(); - } + public WorkerTests() + { + _workflowClient = ApiExtensions.GetClient(); + _logger = ApplicationLogging.CreateLogger(); + } - [Fact] - public async System.Threading.Tasks.Task TestWorkflowAsyncExecution() - { - var workflow = GetConductorWorkflow(); - ApiExtensions.GetWorkflowExecutor().RegisterWorkflow(workflow, true); - var workflowIdList = await StartWorkflows(workflow, quantity: 15); - await ExecuteWorkflowTasks(workflowCompletionTimeout: TimeSpan.FromSeconds(20)); - await ValidateWorkflowCompletion(workflowIdList.ToArray()); - } + [Fact] + public async Task TestWorkflowAsyncExecution() + { + var workflow = GetConductorWorkflow(); + ApiExtensions.GetWorkflowExecutor().RegisterWorkflow(workflow, true); + var workflowIdList = await StartWorkflows(workflow, 15); + await ExecuteWorkflowTasks(TimeSpan.FromSeconds(20)); + await ValidateWorkflowCompletion(workflowIdList.ToArray()); + } - private ConductorWorkflow GetConductorWorkflow() - { - return new ConductorWorkflow() - .WithName(WORKFLOW_NAME) - .WithVersion(WORKFLOW_VERSION) - .WithTask(new SimpleTask(TASK_NAME, TASK_NAME)); - } + private ConductorWorkflow GetConductorWorkflow() + { + return new ConductorWorkflow() + .WithName(WORKFLOW_NAME) + .WithVersion(WORKFLOW_VERSION) + .WithTask(new SimpleTask(TASK_NAME, TASK_NAME)); + } - private async System.Threading.Tasks.Task> StartWorkflows(ConductorWorkflow workflow, int quantity) - { - var startWorkflowRequest = workflow.GetStartWorkflowRequest(); - startWorkflowRequest.TaskToDomain = new Dictionary { { TASK_NAME, TASK_DOMAIN } }; - var startedWorkflows = await WorkflowExtensions.StartWorkflows( - _workflowClient, - startWorkflowRequest, - maxAllowedInParallel: 3, - total: quantity - ); - return startedWorkflows; - } + private async Task> StartWorkflows(ConductorWorkflow workflow, int quantity) + { + var startWorkflowRequest = workflow.GetStartWorkflowRequest(); + startWorkflowRequest.TaskToDomain = new Dictionary { { TASK_NAME, TASK_DOMAIN } }; + var startedWorkflows = await WorkflowExtensions.StartWorkflows( + _workflowClient, + startWorkflowRequest, + 3, + quantity + ); + return startedWorkflows; + } - private async System.Threading.Tasks.Task ExecuteWorkflowTasks(TimeSpan workflowCompletionTimeout) - { - var host = WorkflowTaskHost.CreateWorkerHost(Microsoft.Extensions.Logging.LogLevel.Information, new ClassWorker()); - await host.StartAsync(); - Thread.Sleep(workflowCompletionTimeout); - await host.StopAsync(); - } + private async Task ExecuteWorkflowTasks(TimeSpan workflowCompletionTimeout) + { + var host = WorkflowTaskHost.CreateWorkerHost(LogLevel.Information, new ClassWorker()); + await host.StartAsync(); + Thread.Sleep(workflowCompletionTimeout); + await host.StopAsync(); + } - private async System.Threading.Tasks.Task ValidateWorkflowCompletion(params string[] workflowIdList) - { - var workflowStatusList = await WorkflowExtensions.GetWorkflowStatusList( - _workflowClient, - maxAllowedInParallel: 10, - workflowIdList - ); - var incompleteWorkflowCounter = 0; - foreach (var workflowStatus in workflowStatusList) + private async Task ValidateWorkflowCompletion(params string[] workflowIdList) + { + var workflowStatusList = await WorkflowExtensions.GetWorkflowStatusList( + _workflowClient, + 10, + workflowIdList + ); + var incompleteWorkflowCounter = 0; + foreach (var workflowStatus in workflowStatusList) + if (workflowStatus.Status.Value != WorkflowStatus.StatusEnum.COMPLETED) { - if (workflowStatus.Status.Value != WorkflowStatus.StatusEnum.COMPLETED) - { - incompleteWorkflowCounter += 1; - _logger.LogInformation($"Workflow not completed, workflowId: {workflowStatus.WorkflowId}"); - } + incompleteWorkflowCounter += 1; + _logger.LogInformation($"Workflow not completed, workflowId: {workflowStatus.WorkflowId}"); } - Assert.Equal(0, incompleteWorkflowCounter); - } + + Assert.Equal(0, incompleteWorkflowCounter); } -} +} \ No newline at end of file diff --git a/Tests/Worker/Workers.cs b/Tests/Worker/Workers.cs index b26ebc3f..28d221b4 100644 --- a/Tests/Worker/Workers.cs +++ b/Tests/Worker/Workers.cs @@ -3,8 +3,8 @@ using System.Threading.Tasks; using Conductor.Client.Extensions; using Conductor.Client.Interfaces; -using Conductor.Client.Worker; using Conductor.Client.Models; +using Conductor.Client.Worker; using Task = System.Threading.Tasks.Task; namespace Tests.Worker; @@ -52,8 +52,9 @@ public async Task Execute(Conductor.Client.Models.Task task, Cancell { if (token != CancellationToken.None && token.IsCancellationRequested) throw new Exception("Token request Cancelled"); - - return new TaskResult(status: TaskResult.StatusEnum.COMPLETED, taskId:task.TaskId, workflowInstanceId:task.WorkflowInstanceId); + + return new TaskResult(status: TaskResult.StatusEnum.COMPLETED, taskId: task.TaskId, + workflowInstanceId: task.WorkflowInstanceId); } public TaskResult Execute(Conductor.Client.Models.Task task) diff --git a/Tests/conductor-csharp.test.csproj b/Tests/conductor-csharp.test.csproj index 50d3857b..b238845f 100644 --- a/Tests/conductor-csharp.test.csproj +++ b/Tests/conductor-csharp.test.csproj @@ -1,15 +1,15 @@ - - netcoreapp6.0 - - - - - - - - - - - + + netcoreapp6.0 + + + + + + + + + + + \ No newline at end of file diff --git a/csharp-examples/Runner.cs b/csharp-examples/Runner.cs index 24123c5c..2f4434b7 100644 --- a/csharp-examples/Runner.cs +++ b/csharp-examples/Runner.cs @@ -1,8 +1,7 @@ -using System.Collections; -using conductor.csharp.Client.Extensions; -using Conductor.Client; +using Conductor.Client; using Conductor.Client.Authentication; using Conductor.Client.Extensions; +using conductor.csharp.Client.Extensions; using csharp.examples; using Microsoft.Extensions.Logging; @@ -51,8 +50,7 @@ public async void StartTasks() } while (true) - Thread.Sleep(TimeSpan.FromDays(1));// after 1 year will stop the service - + Thread.Sleep(TimeSpan.FromDays(1)); // after 1 year will stop the service } catch (Exception e) { diff --git a/csharp-examples/TestWorker.cs b/csharp-examples/TestWorker.cs index 477760dc..d51120bd 100644 --- a/csharp-examples/TestWorker.cs +++ b/csharp-examples/TestWorker.cs @@ -11,7 +11,8 @@ public class TestWorker(string taskType) : IWorkflowTask private readonly Random rnd = new(); public string TaskType { get; } = taskType; - public WorkflowTaskExecutorConfiguration WorkerSettings { get; } = new WorkflowTaskExecutorConfiguration() + + public WorkflowTaskExecutorConfiguration WorkerSettings { get; } = new() { BatchSize = 20 }; diff --git a/csharp-examples/WorkFlowExamples.cs b/csharp-examples/WorkFlowExamples.cs index f7ded8b0..400fa719 100644 --- a/csharp-examples/WorkFlowExamples.cs +++ b/csharp-examples/WorkFlowExamples.cs @@ -52,7 +52,7 @@ private ConductorWorkflow GetConductorWorkflow() return conductorWorkFlow; } - + } } diff --git a/csharp-examples/csharp-examples.csproj b/csharp-examples/csharp-examples.csproj index 71d71348..72b21df9 100644 --- a/csharp-examples/csharp-examples.csproj +++ b/csharp-examples/csharp-examples.csproj @@ -1,20 +1,20 @@  - - Exe - net8.0 - csharp_examples - enable - enable - Windows - + + Exe + net8.0 + csharp_examples + enable + enable + Windows + - - - + + + - - - + + +