diff --git a/Conductor/Api/WorkflowResourceApi.cs b/Conductor/Api/WorkflowResourceApi.cs index 4cd83b4..6331f25 100644 --- a/Conductor/Api/WorkflowResourceApi.cs +++ b/Conductor/Api/WorkflowResourceApi.cs @@ -72,26 +72,26 @@ public interface IWorkflowResourceApi : IApiAccessor /// 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); + /// + /// 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 /// @@ -1035,82 +1035,82 @@ public ApiResponse ExecuteWorkflowWithHttpInfo(StartWorkflowRequest (WorkflowRun)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(WorkflowRun))); } - public Object UpdateWorkflowVariables(Workflow workflow) - { - ApiResponse localVarResponse = UpdateWorkflowVariablesWithHttpInfo(workflow); - return localVarResponse.Data; - } - - public ApiResponse UpdateWorkflowVariablesWithHttpInfo(Workflow workflow) - { - // verify the required parameter 'body' is set - if (workflow == null) - throw new ApiException(400, "Missing required parameter 'body' when calling WorkflowResourceApi->Update"); - - 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"); - - var localVarPath = $"/workflow/{workflow.WorkflowId}/variables"; - 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 (workflow != null && workflow.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(workflow.Variables); - } - - // authentication (api_key) required - if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; - } - - 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("Update", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); - } - - /// - /// Gets the workflow by workflow id - /// - /// Thrown when fails to make API call - /// - /// (optional, default to true) - /// (optional, default to false) - /// Workflow - public Workflow GetExecutionStatus(string workflowId, bool? includeTasks = null, bool? summarize = null) + public Object UpdateWorkflowVariables(Workflow workflow) + { + ApiResponse localVarResponse = UpdateWorkflowVariablesWithHttpInfo(workflow); + return localVarResponse.Data; + } + + public ApiResponse UpdateWorkflowVariablesWithHttpInfo(Workflow workflow) + { + // verify the required parameter 'body' is set + if (workflow == null) + throw new ApiException(400, "Missing required parameter 'body' when calling WorkflowResourceApi->Update"); + + 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"); + + var localVarPath = $"/workflow/{workflow.WorkflowId}/variables"; + 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 (workflow != null && workflow.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(workflow.Variables); + } + + // authentication (api_key) required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["X-Authorization"] = this.Configuration.AccessToken; + } + + 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("Update", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); + } + + /// + /// Gets the workflow by workflow id + /// + /// Thrown when fails to make API call + /// + /// (optional, default to true) + /// (optional, default to false) + /// Workflow + public Workflow GetExecutionStatus(string workflowId, bool? includeTasks = null, bool? summarize = null) { ApiResponse localVarResponse = GetExecutionStatusWithHttpInfo(workflowId, includeTasks, summarize); return localVarResponse.Data; diff --git a/Conductor/Definition/ConductorWorkflow.cs b/Conductor/Definition/ConductorWorkflow.cs index 3162957..3a50bbb 100644 --- a/Conductor/Definition/ConductorWorkflow.cs +++ b/Conductor/Definition/ConductorWorkflow.cs @@ -62,14 +62,14 @@ public ConductorWorkflow WithOutputParameter(string key, object value) return this; } - public ConductorWorkflow WithVariable(string key, object value) - { - if (Variables == null) // if workflow does not have any variables, initialize with empty collection - Variables = new Dictionary(); - Variables.Add(key, value); - return this; - } - public ConductorWorkflow WithOwner(string ownerEmail) + public ConductorWorkflow WithVariable(string key, object value) + { + if (Variables == null) // if workflow does not have any variables, initialize with empty collection + Variables = new Dictionary(); + Variables.Add(key, value); + return this; + } + public ConductorWorkflow WithOwner(string ownerEmail) { OwnerEmail = ownerEmail; return this;