Skip to content

Commit 5c92c4a

Browse files
Merge branch 'main' into feature-service-registry
2 parents 9145fb2 + 7cc2931 commit 5c92c4a

9 files changed

Lines changed: 1456 additions & 4 deletions

File tree

src/conductor/client/http/api/task_resource_api.py

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import six
88

99
from conductor.client.http.api_client import ApiClient
10+
from conductor.client.http.models.signal_response import SignalResponse
1011

1112

1213
class TaskResourceApi(object):
@@ -1730,3 +1731,235 @@ def update_task_sync_with_http_info(self, body, workflow_id, task_ref_name, stat
17301731
_preload_content=params.get('_preload_content', True),
17311732
_request_timeout=params.get('_request_timeout'),
17321733
collection_formats=collection_formats)
1734+
1735+
def signal_workflow_task_async(self, workflow_id, status, body, **kwargs): # noqa: E501
1736+
"""Update running task in the workflow with given status and output asynchronously # noqa: E501
1737+
1738+
This method makes a synchronous HTTP request by default. To make an
1739+
asynchronous HTTP request, please pass async_req=True
1740+
>>> thread = api.signal_workflow_task_async(workflow_id, status, body, async_req=True)
1741+
>>> result = thread.get()
1742+
1743+
:param async_req bool
1744+
:param str workflow_id: (required)
1745+
:param str status: (required)
1746+
:param dict(str, object) body: (required)
1747+
:return: None
1748+
If the method is called asynchronously,
1749+
returns the request thread.
1750+
"""
1751+
kwargs['_return_http_data_only'] = True
1752+
if kwargs.get('async_req'):
1753+
return self.signal_workflow_task_async_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501
1754+
else:
1755+
(data) = self.signal_workflow_task_async_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501
1756+
return data
1757+
1758+
def signal_workflow_task_async_with_http_info(self, workflow_id, status, body, **kwargs): # noqa: E501
1759+
"""Update running task in the workflow with given status and output asynchronously # noqa: E501
1760+
1761+
This method makes a synchronous HTTP request by default. To make an
1762+
asynchronous HTTP request, please pass async_req=True
1763+
>>> thread = api.signal_workflow_task_async_with_http_info(workflow_id, status, body, async_req=True)
1764+
>>> result = thread.get()
1765+
1766+
:param async_req bool
1767+
:param str workflow_id: (required)
1768+
:param str status: (required)
1769+
:param dict(str, object) body: (required)
1770+
:return: None
1771+
If the method is called asynchronously,
1772+
returns the request thread.
1773+
"""
1774+
1775+
all_params = ['workflow_id', 'status', 'body'] # noqa: E501
1776+
all_params.append('async_req')
1777+
all_params.append('_return_http_data_only')
1778+
all_params.append('_preload_content')
1779+
all_params.append('_request_timeout')
1780+
1781+
params = locals()
1782+
for key, val in six.iteritems(params['kwargs']):
1783+
if key not in all_params:
1784+
raise TypeError(
1785+
"Got an unexpected keyword argument '%s'"
1786+
" to method signal_workflow_task_async" % key
1787+
)
1788+
params[key] = val
1789+
del params['kwargs']
1790+
# verify the required parameter 'workflow_id' is set
1791+
if ('workflow_id' not in params or
1792+
params['workflow_id'] is None):
1793+
raise ValueError(
1794+
"Missing the required parameter `workflow_id` when calling `signal_workflow_task_async`") # noqa: E501
1795+
# verify the required parameter 'status' is set
1796+
if ('status' not in params or
1797+
params['status'] is None):
1798+
raise ValueError(
1799+
"Missing the required parameter `status` when calling `signal_workflow_task_async`") # noqa: E501
1800+
# verify the required parameter 'body' is set
1801+
if ('body' not in params or
1802+
params['body'] is None):
1803+
raise ValueError(
1804+
"Missing the required parameter `body` when calling `signal_workflow_task_async`") # noqa: E501
1805+
1806+
collection_formats = {}
1807+
1808+
path_params = {}
1809+
if 'workflow_id' in params:
1810+
path_params['workflowId'] = params['workflow_id'] # noqa: E501
1811+
if 'status' in params:
1812+
path_params['status'] = params['status'] # noqa: E501
1813+
1814+
query_params = []
1815+
1816+
header_params = {}
1817+
1818+
form_params = []
1819+
local_var_files = {}
1820+
1821+
body_params = None
1822+
if 'body' in params:
1823+
body_params = params['body']
1824+
# HTTP header `Content-Type`
1825+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
1826+
['application/json']) # noqa: E501
1827+
1828+
# Authentication setting
1829+
auth_settings = [] # noqa: E501
1830+
1831+
return self.api_client.call_api(
1832+
'/tasks/{workflowId}/{status}/signal', 'POST',
1833+
path_params,
1834+
query_params,
1835+
header_params,
1836+
body=body_params,
1837+
post_params=form_params,
1838+
files=local_var_files,
1839+
response_type=None, # noqa: E501
1840+
auth_settings=auth_settings,
1841+
async_req=params.get('async_req'),
1842+
_return_http_data_only=params.get('_return_http_data_only'),
1843+
_preload_content=params.get('_preload_content', True),
1844+
_request_timeout=params.get('_request_timeout'),
1845+
collection_formats=collection_formats)
1846+
1847+
def signal_workflow_task_sync(self, workflow_id, status, body, **kwargs): # noqa: E501
1848+
"""Update running task in the workflow with given status and output synchronously and return back updated workflow # noqa: E501
1849+
1850+
This method makes a synchronous HTTP request by default. To make an
1851+
asynchronous HTTP request, please pass async_req=True
1852+
>>> thread = api.signal_workflow_task_sync(workflow_id, status, body, async_req=True)
1853+
>>> result = thread.get()
1854+
1855+
:param async_req bool
1856+
:param str workflow_id: (required)
1857+
:param str status: (required)
1858+
:param dict(str, object) body: (required)
1859+
:param str return_strategy:
1860+
:return: SignalResponse
1861+
If the method is called asynchronously,
1862+
returns the request thread.
1863+
"""
1864+
kwargs['_return_http_data_only'] = True
1865+
if kwargs.get('async_req'):
1866+
return self.signal_workflow_task_sync_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501
1867+
else:
1868+
(data) = self.signal_workflow_task_sync_with_http_info(workflow_id, status, body, **kwargs) # noqa: E501
1869+
return data
1870+
1871+
def signal_workflow_task_sync_with_http_info(self, workflow_id, status, body, **kwargs): # noqa: E501
1872+
"""Update running task in the workflow with given status and output synchronously and return back updated workflow # noqa: E501
1873+
1874+
This method makes a synchronous HTTP request by default. To make an
1875+
asynchronous HTTP request, please pass async_req=True
1876+
>>> thread = api.signal_workflow_task_sync_with_http_info(workflow_id, status, body, async_req=True)
1877+
>>> result = thread.get()
1878+
1879+
:param async_req bool
1880+
:param str workflow_id: (required)
1881+
:param str status: (required)
1882+
:param dict(str, object) body: (required)
1883+
:param str return_strategy:
1884+
:return: SignalResponse
1885+
If the method is called asynchronously,
1886+
returns the request thread.
1887+
"""
1888+
1889+
all_params = ['workflow_id', 'status', 'body', 'return_strategy'] # noqa: E501
1890+
all_params.append('async_req')
1891+
all_params.append('_return_http_data_only')
1892+
all_params.append('_preload_content')
1893+
all_params.append('_request_timeout')
1894+
1895+
params = locals()
1896+
for key, val in six.iteritems(params['kwargs']):
1897+
if key not in all_params:
1898+
raise TypeError(
1899+
"Got an unexpected keyword argument '%s'"
1900+
" to method signal_workflow_task_sync" % key
1901+
)
1902+
params[key] = val
1903+
del params['kwargs']
1904+
# verify the required parameter 'workflow_id' is set
1905+
if ('workflow_id' not in params or
1906+
params['workflow_id'] is None):
1907+
raise ValueError(
1908+
"Missing the required parameter `workflow_id` when calling `signal_workflow_task_sync`") # noqa: E501
1909+
# verify the required parameter 'status' is set
1910+
if ('status' not in params or
1911+
params['status'] is None):
1912+
raise ValueError(
1913+
"Missing the required parameter `status` when calling `signal_workflow_task_sync`") # noqa: E501
1914+
# verify the required parameter 'body' is set
1915+
if ('body' not in params or
1916+
params['body'] is None):
1917+
raise ValueError(
1918+
"Missing the required parameter `body` when calling `signal_workflow_task_sync`") # noqa: E501
1919+
1920+
collection_formats = {}
1921+
1922+
path_params = {}
1923+
if 'workflow_id' in params:
1924+
path_params['workflowId'] = params['workflow_id'] # noqa: E501
1925+
if 'status' in params:
1926+
path_params['status'] = params['status'] # noqa: E501
1927+
1928+
query_params = []
1929+
if 'return_strategy' in params and params['return_strategy'] is not None:
1930+
query_params.append(('returnStrategy', params['return_strategy'])) # noqa: E501
1931+
1932+
header_params = {}
1933+
1934+
form_params = []
1935+
local_var_files = {}
1936+
1937+
body_params = None
1938+
if 'body' in params:
1939+
body_params = params['body']
1940+
# HTTP header `Accept`
1941+
header_params['Accept'] = self.api_client.select_header_accept(
1942+
['application/json']) # noqa: E501
1943+
1944+
# HTTP header `Content-Type`
1945+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
1946+
['application/json']) # noqa: E501
1947+
1948+
# Authentication setting
1949+
auth_settings = [] # noqa: E501
1950+
1951+
return self.api_client.call_api(
1952+
'/tasks/{workflowId}/{status}/signal/sync', 'POST',
1953+
path_params,
1954+
query_params,
1955+
header_params,
1956+
body=body_params,
1957+
post_params=form_params,
1958+
files=local_var_files,
1959+
response_type='SignalResponse', # noqa: E501
1960+
auth_settings=auth_settings,
1961+
async_req=params.get('async_req'),
1962+
_return_http_data_only=params.get('_return_http_data_only'),
1963+
_preload_content=params.get('_preload_content', True),
1964+
_request_timeout=params.get('_request_timeout'),
1965+
collection_formats=collection_formats)

src/conductor/client/http/models/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,5 @@
6161
from conductor.client.http.models.request_param import RequestParam, Schema
6262
from conductor.client.http.models.proto_registry_entry import ProtoRegistryEntry
6363
from conductor.client.http.models.service_method import ServiceMethod
64-
from conductor.client.http.models.circuit_breaker_transition_response import CircuitBreakerTransitionResponse
64+
from conductor.client.http.models.circuit_breaker_transition_response import CircuitBreakerTransitionResponse
65+
from conductor.client.http.models.signal_response import SignalResponse, TaskStatus

0 commit comments

Comments
 (0)