1414from ...errors .unauthorized_error import UnauthorizedError
1515from ...types .api_error import ApiError as types_api_error_ApiError
1616from ...types .bulk_sync_execution_envelope import BulkSyncExecutionEnvelope
17+ from ...types .list_bulk_sync_execution_status_envelope import ListBulkSyncExecutionStatusEnvelope
1718from ...types .list_bulk_sync_executions_envelope import ListBulkSyncExecutionsEnvelope
1819from ...types .rest_err_response import RestErrResponse
1920
@@ -22,6 +23,87 @@ class ExecutionsClient:
2223 def __init__ (self , * , client_wrapper : SyncClientWrapper ):
2324 self ._client_wrapper = client_wrapper
2425
26+ def list_status (
27+ self ,
28+ * ,
29+ all_ : typing .Optional [bool ] = None ,
30+ active : typing .Optional [bool ] = None ,
31+ sync_id : typing .Optional [typing .Union [str , typing .Sequence [str ]]] = None ,
32+ request_options : typing .Optional [RequestOptions ] = None ,
33+ ) -> ListBulkSyncExecutionStatusEnvelope :
34+ """
35+ Parameters
36+ ----------
37+ all_ : typing.Optional[bool]
38+ Return the execution status of all syncs in the organization
39+
40+ active : typing.Optional[bool]
41+ Return the execution status of all active syncs in the organization
42+
43+ sync_id : typing.Optional[typing.Union[str, typing.Sequence[str]]]
44+ Return the execution status of the specified sync; this may be supplied multiple times.
45+
46+ request_options : typing.Optional[RequestOptions]
47+ Request-specific configuration.
48+
49+ Returns
50+ -------
51+ ListBulkSyncExecutionStatusEnvelope
52+ OK
53+
54+ Examples
55+ --------
56+ from polytomic.client import Polytomic
57+
58+ client = Polytomic(
59+ version="YOUR_VERSION",
60+ token="YOUR_TOKEN",
61+ )
62+ client.bulk_sync.executions.list_status()
63+ """
64+ _response = self ._client_wrapper .httpx_client .request (
65+ method = "GET" ,
66+ url = urllib .parse .urljoin (f"{ self ._client_wrapper .get_base_url ()} /" , "api/bulk/syncs/status" ),
67+ params = jsonable_encoder (
68+ remove_none_from_dict (
69+ {
70+ "all" : all_ ,
71+ "active" : active ,
72+ "sync_id" : sync_id ,
73+ ** (
74+ request_options .get ("additional_query_parameters" , {})
75+ if request_options is not None
76+ else {}
77+ ),
78+ }
79+ )
80+ ),
81+ headers = jsonable_encoder (
82+ remove_none_from_dict (
83+ {
84+ ** self ._client_wrapper .get_headers (),
85+ ** (request_options .get ("additional_headers" , {}) if request_options is not None else {}),
86+ }
87+ )
88+ ),
89+ timeout = request_options .get ("timeout_in_seconds" )
90+ if request_options is not None and request_options .get ("timeout_in_seconds" ) is not None
91+ else self ._client_wrapper .get_timeout (),
92+ retries = 0 ,
93+ max_retries = request_options .get ("max_retries" ) if request_options is not None else 0 , # type: ignore
94+ )
95+ if 200 <= _response .status_code < 300 :
96+ return pydantic_v1 .parse_obj_as (ListBulkSyncExecutionStatusEnvelope , _response .json ()) # type: ignore
97+ if _response .status_code == 401 :
98+ raise UnauthorizedError (pydantic_v1 .parse_obj_as (RestErrResponse , _response .json ())) # type: ignore
99+ if _response .status_code == 404 :
100+ raise NotFoundError (pydantic_v1 .parse_obj_as (types_api_error_ApiError , _response .json ())) # type: ignore
101+ try :
102+ _response_json = _response .json ()
103+ except JSONDecodeError :
104+ raise core_api_error_ApiError (status_code = _response .status_code , body = _response .text )
105+ raise core_api_error_ApiError (status_code = _response .status_code , body = _response_json )
106+
25107 def list (
26108 self , id : str , * , request_options : typing .Optional [RequestOptions ] = None
27109 ) -> ListBulkSyncExecutionsEnvelope :
@@ -155,6 +237,87 @@ class AsyncExecutionsClient:
155237 def __init__ (self , * , client_wrapper : AsyncClientWrapper ):
156238 self ._client_wrapper = client_wrapper
157239
240+ async def list_status (
241+ self ,
242+ * ,
243+ all_ : typing .Optional [bool ] = None ,
244+ active : typing .Optional [bool ] = None ,
245+ sync_id : typing .Optional [typing .Union [str , typing .Sequence [str ]]] = None ,
246+ request_options : typing .Optional [RequestOptions ] = None ,
247+ ) -> ListBulkSyncExecutionStatusEnvelope :
248+ """
249+ Parameters
250+ ----------
251+ all_ : typing.Optional[bool]
252+ Return the execution status of all syncs in the organization
253+
254+ active : typing.Optional[bool]
255+ Return the execution status of all active syncs in the organization
256+
257+ sync_id : typing.Optional[typing.Union[str, typing.Sequence[str]]]
258+ Return the execution status of the specified sync; this may be supplied multiple times.
259+
260+ request_options : typing.Optional[RequestOptions]
261+ Request-specific configuration.
262+
263+ Returns
264+ -------
265+ ListBulkSyncExecutionStatusEnvelope
266+ OK
267+
268+ Examples
269+ --------
270+ from polytomic.client import AsyncPolytomic
271+
272+ client = AsyncPolytomic(
273+ version="YOUR_VERSION",
274+ token="YOUR_TOKEN",
275+ )
276+ await client.bulk_sync.executions.list_status()
277+ """
278+ _response = await self ._client_wrapper .httpx_client .request (
279+ method = "GET" ,
280+ url = urllib .parse .urljoin (f"{ self ._client_wrapper .get_base_url ()} /" , "api/bulk/syncs/status" ),
281+ params = jsonable_encoder (
282+ remove_none_from_dict (
283+ {
284+ "all" : all_ ,
285+ "active" : active ,
286+ "sync_id" : sync_id ,
287+ ** (
288+ request_options .get ("additional_query_parameters" , {})
289+ if request_options is not None
290+ else {}
291+ ),
292+ }
293+ )
294+ ),
295+ headers = jsonable_encoder (
296+ remove_none_from_dict (
297+ {
298+ ** self ._client_wrapper .get_headers (),
299+ ** (request_options .get ("additional_headers" , {}) if request_options is not None else {}),
300+ }
301+ )
302+ ),
303+ timeout = request_options .get ("timeout_in_seconds" )
304+ if request_options is not None and request_options .get ("timeout_in_seconds" ) is not None
305+ else self ._client_wrapper .get_timeout (),
306+ retries = 0 ,
307+ max_retries = request_options .get ("max_retries" ) if request_options is not None else 0 , # type: ignore
308+ )
309+ if 200 <= _response .status_code < 300 :
310+ return pydantic_v1 .parse_obj_as (ListBulkSyncExecutionStatusEnvelope , _response .json ()) # type: ignore
311+ if _response .status_code == 401 :
312+ raise UnauthorizedError (pydantic_v1 .parse_obj_as (RestErrResponse , _response .json ())) # type: ignore
313+ if _response .status_code == 404 :
314+ raise NotFoundError (pydantic_v1 .parse_obj_as (types_api_error_ApiError , _response .json ())) # type: ignore
315+ try :
316+ _response_json = _response .json ()
317+ except JSONDecodeError :
318+ raise core_api_error_ApiError (status_code = _response .status_code , body = _response .text )
319+ raise core_api_error_ApiError (status_code = _response .status_code , body = _response_json )
320+
158321 async def list (
159322 self , id : str , * , request_options : typing .Optional [RequestOptions ] = None
160323 ) -> ListBulkSyncExecutionsEnvelope :
0 commit comments