Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
233 changes: 233 additions & 0 deletions src/conductor/client/http/api/task_resource_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import six

from conductor.client.http.api_client import ApiClient
from conductor.client.http.models.signal_response import SignalResponse


class TaskResourceApi(object):
Expand Down Expand Up @@ -1730,3 +1731,235 @@ def update_task_sync_with_http_info(self, body, workflow_id, task_ref_name, stat
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def signal_workflow_task_async(self, workflow_id, status, body, **kwargs): # noqa: E501
"""Update running task in the workflow with given status and output asynchronously # noqa: E501

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

:param async_req bool
:param str workflow_id: (required)
:param str status: (required)
:param dict(str, object) body: (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.signal_workflow_task_async_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501
else:
(data) = self.signal_workflow_task_async_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501
return data

def signal_workflow_task_async_with_http_info(self, workflow_id, status, body, **kwargs): # noqa: E501
"""Update running task in the workflow with given status and output asynchronously # noqa: E501

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

:param async_req bool
:param str workflow_id: (required)
:param str status: (required)
:param dict(str, object) body: (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['workflow_id', 'status', 'body'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')

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 signal_workflow_task_async" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'workflow_id' is set
if ('workflow_id' not in params or
params['workflow_id'] is None):
raise ValueError(
"Missing the required parameter `workflow_id` when calling `signal_workflow_task_async`") # noqa: E501
# verify the required parameter 'status' is set
if ('status' not in params or
params['status'] is None):
raise ValueError(
"Missing the required parameter `status` when calling `signal_workflow_task_async`") # noqa: E501
# 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 `signal_workflow_task_async`") # noqa: E501

collection_formats = {}

path_params = {}
if 'workflow_id' in params:
path_params['workflowId'] = params['workflow_id'] # noqa: E501
if 'status' in params:
path_params['status'] = params['status'] # noqa: E501

query_params = []

header_params = {}

form_params = []
local_var_files = {}

body_params = None
if 'body' in params:
body_params = params['body']
# 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 = [] # noqa: E501

return self.api_client.call_api(
'/tasks/{workflowId}/{status}/signal', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # 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)

def signal_workflow_task_sync(self, workflow_id, status, body, **kwargs): # noqa: E501
"""Update running task in the workflow with given status and output synchronously and return back updated workflow # noqa: E501

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

:param async_req bool
:param str workflow_id: (required)
:param str status: (required)
:param dict(str, object) body: (required)
:param str return_strategy:
:return: SignalResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.signal_workflow_task_sync_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501
else:
(data) = self.signal_workflow_task_sync_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501
return data

def signal_workflow_task_sync_with_http_info(self, workflow_id, status, body, **kwargs): # noqa: E501
"""Update running task in the workflow with given status and output synchronously and return back updated workflow # noqa: E501

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

:param async_req bool
:param str workflow_id: (required)
:param str status: (required)
:param dict(str, object) body: (required)
:param str return_strategy:
:return: SignalResponse
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['workflow_id', 'status', 'body', 'return_strategy'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')

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 signal_workflow_task_sync" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'workflow_id' is set
if ('workflow_id' not in params or
params['workflow_id'] is None):
raise ValueError(
"Missing the required parameter `workflow_id` when calling `signal_workflow_task_sync`") # noqa: E501
# verify the required parameter 'status' is set
if ('status' not in params or
params['status'] is None):
raise ValueError(
"Missing the required parameter `status` when calling `signal_workflow_task_sync`") # noqa: E501
# 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 `signal_workflow_task_sync`") # noqa: E501

collection_formats = {}

path_params = {}
if 'workflow_id' in params:
path_params['workflowId'] = params['workflow_id'] # noqa: E501
if 'status' in params:
path_params['status'] = params['status'] # noqa: E501

query_params = []
if 'return_strategy' in params and params['return_strategy'] is not None:
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 = [] # noqa: E501

return self.api_client.call_api(
'/tasks/{workflowId}/{status}/signal/sync', '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)
3 changes: 2 additions & 1 deletion src/conductor/client/http/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@
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.schema_def import SchemaDef
from conductor.client.http.models.schema_def import SchemaType
from conductor.client.http.models.schema_def import SchemaType
from conductor.client.http.models.signal_response import SignalResponse, TaskStatus
Loading