Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions src/conductor/client/http/api/workflow_resource_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3051,4 +3051,135 @@ def update_workflow_and_task_state_with_http_info(self, body, request_id, workfl
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def execute_workflow_cr(self, body, name, version, **kwargs): # noqa: E501
Comment thread
orkes-harshil marked this conversation as resolved.
Outdated
"""Execute a workflow synchronously with reactive response # noqa: E501

This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.execute_workflow_cr(body,name,version)
>>> result = thread.get()

:param async_req bool
:param StartWorkflowRequest body: (required)
:param str name: (required)
:param int version: (required)
:param str request_id:
:param str wait_until_task_ref:
:param int wait_for_seconds:
:param str consistency: DURABLE or EVENTUAL
:param str return_strategy: TARGET_WORKFLOW or WAIT_WORKFLOW
:return: WorkflowRun
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.execute_workflow_reactive_with_http_info(body, name, version, **kwargs) # noqa: E501
else:
(data) = self.execute_workflow_reactive_with_http_info(body, name, version, **kwargs) # noqa: E501
return data

def execute_workflow_reactive_with_http_info(self, body, name, version, **kwargs): # noqa: E501
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea why we say reactive in method name ? execute_workflow_reactive_with_http_info

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes -this is not needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll change this

"""Execute a workflow synchronously with reactive response # noqa: E501

This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.execute_workflow_reactive_with_http_info(body, name, version, async_req=True)
>>> result = thread.get()

:param async_req bool
:param StartWorkflowRequest body: (required)
:param str name: (required)
:param int version: (required)
:param str request_id:
:param str wait_until_task_ref:
:param int wait_for_seconds:
:param str consistency: DURABLE or EVENTUAL
:param str return_strategy: TARGET_WORKFLOW or WAIT_WORKFLOW
:return: WorkflowRun
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['body', 'name', 'version', 'request_id', 'wait_until_task_ref', 'wait_for_seconds', 'consistency',
'return_strategy', 'async_req', '_return_http_data_only', '_preload_content',
'_request_timeout'] # noqa: E501

params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method execute_workflow" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `execute_workflow`") # noqa: E501
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `execute_workflow`") # noqa: E501
# verify the required parameter 'version' is set
if ('version' not in params or
params['version'] is None):
raise ValueError("Missing the required parameter `version` when calling `execute_workflow`") # noqa: E501

collection_formats = {}

path_params = {}
if 'name' in params:
path_params['name'] = params['name'] # noqa: E501
if 'version' in params:
path_params['version'] = params['version'] # noqa: E501

query_params = []
if 'request_id' in params:
query_params.append(('requestId', params['request_id'])) # noqa: E501
if 'wait_until_task_ref' in params:
query_params.append(('waitUntilTaskRef', params['wait_until_task_ref'])) # noqa: E501
if 'wait_for_seconds' in params:
query_params.append(('waitForSeconds', params['wait_for_seconds'])) # noqa: E501
if 'consistency' in params:
query_params.append(('consistency', params['consistency'])) # noqa: E501
if 'return_strategy' in params:
query_params.append(('returnStrategy', params['return_strategy'])) # noqa: E501

header_params = {}

form_params = []
local_var_files = {}

body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501

# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501

# Authentication setting
auth_settings = ['api_key'] # noqa: E501

return self.api_client.call_api(
'/workflow/execute/{name}/{version}', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='SignalResponse', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
1 change: 1 addition & 0 deletions src/conductor/client/http/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@
from conductor.client.http.models.integration_api import IntegrationApi
from conductor.client.http.models.state_change_event import StateChangeEvent, StateChangeConfig, StateChangeEventType
from conductor.client.http.models.workflow_task import CacheConfig
from conductor.client.http.models.signal_response_1 import SignalResponse, TaskStatus
from conductor.client.http.models.schema_def import SchemaDef
from conductor.client.http.models.schema_def import SchemaType
Loading