Skip to content

Commit ad27f9f

Browse files
Release 1.7.0
1 parent e80fad1 commit ad27f9f

File tree

11 files changed

+419
-120
lines changed

11 files changed

+419
-120
lines changed

poetry.lock

Lines changed: 97 additions & 85 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "polytomic"
3-
version = "1.6.2"
3+
version = "1.7.0"
44
description = ""
55
readme = "README.md"
66
authors = []

src/polytomic/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@
2222
BulkSyncDestEnvelope,
2323
BulkSyncExecution,
2424
BulkSyncExecutionEnvelope,
25+
BulkSyncExecutionStatus,
2526
BulkSyncListEnvelope,
2627
BulkSyncResponse,
2728
BulkSyncResponseEnvelope,
2829
BulkSyncSchemaExecution,
30+
BulkSyncSchemaExecutionStatus,
2931
BulkSyncSource,
3032
BulkSyncSourceEnvelope,
3133
BulkSyncSourceSchemaEnvelope,
@@ -75,6 +77,7 @@
7577
JsonschemaForm,
7678
LabelLabel,
7779
ListBulkSchema,
80+
ListBulkSyncExecutionStatusEnvelope,
7881
ListBulkSyncExecutionsEnvelope,
7982
ListExecutionResponseEnvelope,
8083
ListModelSyncResponseEnvelope,
@@ -199,10 +202,12 @@
199202
"BulkSyncDestEnvelope",
200203
"BulkSyncExecution",
201204
"BulkSyncExecutionEnvelope",
205+
"BulkSyncExecutionStatus",
202206
"BulkSyncListEnvelope",
203207
"BulkSyncResponse",
204208
"BulkSyncResponseEnvelope",
205209
"BulkSyncSchemaExecution",
210+
"BulkSyncSchemaExecutionStatus",
206211
"BulkSyncSource",
207212
"BulkSyncSourceEnvelope",
208213
"BulkSyncSourceSchemaEnvelope",
@@ -254,6 +259,7 @@
254259
"JsonschemaForm",
255260
"LabelLabel",
256261
"ListBulkSchema",
262+
"ListBulkSyncExecutionStatusEnvelope",
257263
"ListBulkSyncExecutionsEnvelope",
258264
"ListExecutionResponseEnvelope",
259265
"ListModelSyncResponseEnvelope",

src/polytomic/bulk_sync/executions/client.py

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from ...errors.unauthorized_error import UnauthorizedError
1515
from ...types.api_error import ApiError as types_api_error_ApiError
1616
from ...types.bulk_sync_execution_envelope import BulkSyncExecutionEnvelope
17+
from ...types.list_bulk_sync_execution_status_envelope import ListBulkSyncExecutionStatusEnvelope
1718
from ...types.list_bulk_sync_executions_envelope import ListBulkSyncExecutionsEnvelope
1819
from ...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:

src/polytomic/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def get_headers(self) -> typing.Dict[str, str]:
2525
headers: typing.Dict[str, str] = {
2626
"X-Fern-Language": "Python",
2727
"X-Fern-SDK-Name": "polytomic",
28-
"X-Fern-SDK-Version": "1.6.2",
28+
"X-Fern-SDK-Version": "1.7.0",
2929
}
3030
if self._version is not None:
3131
headers["X-Polytomic-Version"] = self._version

0 commit comments

Comments
 (0)