Skip to content

Commit 99d6563

Browse files
committed
Release 0.0.775
1 parent 84c756e commit 99d6563

30 files changed

Lines changed: 330 additions & 276 deletions

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 = "revert-api"
3-
version = "0.0.745"
3+
version = "0.0.775"
44
description = ""
55
readme = "README.md"
66
authors = []

src/revert/__init__.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,67 @@
11
# This file was auto-generated by Fern from our API Definition.
22

33
from .resources import (
4+
ConnectionStatus,
5+
CreateAccountFieldMappingRequestBody,
6+
CreateAccountFieldMappingResponse,
47
CreateConnectionWebhookRequest,
58
CreateConnectionWebhookResponse,
9+
CreateFieldMappingRequestBody,
10+
CreateFieldMappingResponse,
611
CrmMetadata,
712
CrmMetadataResponse,
813
CrmStatus,
14+
DeleteAccountFieldMappingConfigResponse,
915
DeleteConnectionResponse,
1016
DeleteConnectionWebhookResponse,
17+
DeleteFieldMappingResponse,
18+
FieldMappingType,
1119
GetAllConnectionResponse,
20+
GetConnectStatusResponse,
1221
GetConnectionResponse,
1322
GetConnectionWebhookResponse,
23+
GetFieldMappingConfigResponse,
24+
GetFieldMappingsResponse,
25+
MappableFieldType,
1426
chat,
1527
common,
1628
connection,
1729
crm,
30+
field_mapping,
1831
metadata,
1932
ticket,
2033
)
2134
from .environment import RevertEnvironment
2235

2336
__all__ = [
37+
"ConnectionStatus",
38+
"CreateAccountFieldMappingRequestBody",
39+
"CreateAccountFieldMappingResponse",
2440
"CreateConnectionWebhookRequest",
2541
"CreateConnectionWebhookResponse",
42+
"CreateFieldMappingRequestBody",
43+
"CreateFieldMappingResponse",
2644
"CrmMetadata",
2745
"CrmMetadataResponse",
2846
"CrmStatus",
47+
"DeleteAccountFieldMappingConfigResponse",
2948
"DeleteConnectionResponse",
3049
"DeleteConnectionWebhookResponse",
50+
"DeleteFieldMappingResponse",
51+
"FieldMappingType",
3152
"GetAllConnectionResponse",
53+
"GetConnectStatusResponse",
3254
"GetConnectionResponse",
3355
"GetConnectionWebhookResponse",
56+
"GetFieldMappingConfigResponse",
57+
"GetFieldMappingsResponse",
58+
"MappableFieldType",
3459
"RevertEnvironment",
3560
"chat",
3661
"common",
3762
"connection",
3863
"crm",
64+
"field_mapping",
3965
"metadata",
4066
"ticket",
4167
]

src/revert/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .resources.chat.client import AsyncChatClient, ChatClient
1010
from .resources.connection.client import AsyncConnectionClient, ConnectionClient
1111
from .resources.crm.client import AsyncCrmClient, CrmClient
12+
from .resources.field_mapping.client import AsyncFieldMappingClient, FieldMappingClient
1213
from .resources.metadata.client import AsyncMetadataClient, MetadataClient
1314
from .resources.ticket.client import AsyncTicketClient, TicketClient
1415

@@ -29,6 +30,7 @@ def __init__(
2930
self.chat = ChatClient(client_wrapper=self._client_wrapper)
3031
self.connection = ConnectionClient(client_wrapper=self._client_wrapper)
3132
self.crm = CrmClient(client_wrapper=self._client_wrapper)
33+
self.field_mapping = FieldMappingClient(client_wrapper=self._client_wrapper)
3234
self.metadata = MetadataClient(client_wrapper=self._client_wrapper)
3335
self.ticket = TicketClient(client_wrapper=self._client_wrapper)
3436

@@ -49,6 +51,7 @@ def __init__(
4951
self.chat = AsyncChatClient(client_wrapper=self._client_wrapper)
5052
self.connection = AsyncConnectionClient(client_wrapper=self._client_wrapper)
5153
self.crm = AsyncCrmClient(client_wrapper=self._client_wrapper)
54+
self.field_mapping = AsyncFieldMappingClient(client_wrapper=self._client_wrapper)
5255
self.metadata = AsyncMetadataClient(client_wrapper=self._client_wrapper)
5356
self.ticket = AsyncTicketClient(client_wrapper=self._client_wrapper)
5457

src/revert/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1313
headers: typing.Dict[str, str] = {
1414
"X-Fern-Language": "Python",
1515
"X-Fern-SDK-Name": "revert-api",
16-
"X-Fern-SDK-Version": "0.0.745",
16+
"X-Fern-SDK-Version": "0.0.775",
1717
}
1818
return headers
1919

src/revert/resources/__init__.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,59 @@
11
# This file was auto-generated by Fern from our API Definition.
22

3-
from . import chat, common, connection, crm, metadata, ticket
3+
from . import chat, common, connection, crm, field_mapping, metadata, ticket
44
from .connection import (
5+
ConnectionStatus,
56
CreateConnectionWebhookRequest,
67
CreateConnectionWebhookResponse,
78
DeleteConnectionResponse,
89
DeleteConnectionWebhookResponse,
910
GetAllConnectionResponse,
11+
GetConnectStatusResponse,
1012
GetConnectionResponse,
1113
GetConnectionWebhookResponse,
1214
)
15+
from .field_mapping import (
16+
CreateAccountFieldMappingRequestBody,
17+
CreateAccountFieldMappingResponse,
18+
CreateFieldMappingRequestBody,
19+
CreateFieldMappingResponse,
20+
DeleteAccountFieldMappingConfigResponse,
21+
DeleteFieldMappingResponse,
22+
FieldMappingType,
23+
GetFieldMappingConfigResponse,
24+
GetFieldMappingsResponse,
25+
MappableFieldType,
26+
)
1327
from .metadata import CrmMetadata, CrmMetadataResponse, CrmStatus
1428

1529
__all__ = [
30+
"ConnectionStatus",
31+
"CreateAccountFieldMappingRequestBody",
32+
"CreateAccountFieldMappingResponse",
1633
"CreateConnectionWebhookRequest",
1734
"CreateConnectionWebhookResponse",
35+
"CreateFieldMappingRequestBody",
36+
"CreateFieldMappingResponse",
1837
"CrmMetadata",
1938
"CrmMetadataResponse",
2039
"CrmStatus",
40+
"DeleteAccountFieldMappingConfigResponse",
2141
"DeleteConnectionResponse",
2242
"DeleteConnectionWebhookResponse",
43+
"DeleteFieldMappingResponse",
44+
"FieldMappingType",
2345
"GetAllConnectionResponse",
46+
"GetConnectStatusResponse",
2447
"GetConnectionResponse",
2548
"GetConnectionWebhookResponse",
49+
"GetFieldMappingConfigResponse",
50+
"GetFieldMappingsResponse",
51+
"MappableFieldType",
2652
"chat",
2753
"common",
2854
"connection",
2955
"crm",
56+
"field_mapping",
3057
"metadata",
3158
"ticket",
3259
]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
# This file was auto-generated by Fern from our API Definition.
22

33
from .types import (
4+
ConnectionStatus,
45
CreateConnectionWebhookRequest,
56
CreateConnectionWebhookResponse,
67
DeleteConnectionResponse,
78
DeleteConnectionWebhookResponse,
89
GetAllConnectionResponse,
10+
GetConnectStatusResponse,
911
GetConnectionResponse,
1012
GetConnectionWebhookResponse,
1113
)
1214

1315
__all__ = [
16+
"ConnectionStatus",
1417
"CreateConnectionWebhookRequest",
1518
"CreateConnectionWebhookResponse",
1619
"DeleteConnectionResponse",
1720
"DeleteConnectionWebhookResponse",
1821
"GetAllConnectionResponse",
22+
"GetConnectStatusResponse",
1923
"GetConnectionResponse",
2024
"GetConnectionWebhookResponse",
2125
]

src/revert/resources/connection/client.py

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from .types.delete_connection_response import DeleteConnectionResponse
1818
from .types.delete_connection_webhook_response import DeleteConnectionWebhookResponse
1919
from .types.get_all_connection_response import GetAllConnectionResponse
20+
from .types.get_connect_status_response import GetConnectStatusResponse
2021
from .types.get_connection_response import GetConnectionResponse
2122
from .types.get_connection_webhook_response import GetConnectionWebhookResponse
2223

@@ -278,6 +279,53 @@ def delete_webhook(
278279
raise ApiError(status_code=_response.status_code, body=_response.text)
279280
raise ApiError(status_code=_response.status_code, body=_response_json)
280281

282+
def get_integration_status(
283+
self,
284+
revert_public_token: str,
285+
*,
286+
tenant_id: str,
287+
x_revert_api_token: str,
288+
x_api_version: typing.Optional[str] = None,
289+
) -> GetConnectStatusResponse:
290+
"""
291+
Get the OAuth connection event status. This endpoint responds with a `http.ServerResponse` instead of `json`.
292+
293+
Parameters:
294+
- revert_public_token: str.
295+
296+
- tenant_id: str.
297+
298+
- x_revert_api_token: str. Your official API key for accessing revert apis.
299+
300+
- x_api_version: typing.Optional[str]. Optional Revert API version you're using. If missing we default to the latest version of the API.
301+
"""
302+
_response = self._client_wrapper.httpx_client.request(
303+
"GET",
304+
urllib.parse.urljoin(
305+
f"{self._client_wrapper.get_base_url()}/", f"connection/integration-status/{revert_public_token}"
306+
),
307+
params=remove_none_from_dict({"tenantId": tenant_id}),
308+
headers=remove_none_from_dict(
309+
{
310+
**self._client_wrapper.get_headers(),
311+
"x-revert-api-token": x_revert_api_token,
312+
"x-api-version": x_api_version,
313+
}
314+
),
315+
timeout=None,
316+
)
317+
if 200 <= _response.status_code < 300:
318+
return pydantic.parse_obj_as(GetConnectStatusResponse, _response.json()) # type: ignore
319+
if _response.status_code == 401:
320+
raise UnAuthorizedError(pydantic.parse_obj_as(BaseError, _response.json())) # type: ignore
321+
if _response.status_code == 500:
322+
raise InternalServerError(pydantic.parse_obj_as(BaseError, _response.json())) # type: ignore
323+
try:
324+
_response_json = _response.json()
325+
except JSONDecodeError:
326+
raise ApiError(status_code=_response.status_code, body=_response.text)
327+
raise ApiError(status_code=_response.status_code, body=_response_json)
328+
281329

282330
class AsyncConnectionClient:
283331
def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -527,3 +575,50 @@ async def delete_webhook(
527575
except JSONDecodeError:
528576
raise ApiError(status_code=_response.status_code, body=_response.text)
529577
raise ApiError(status_code=_response.status_code, body=_response_json)
578+
579+
async def get_integration_status(
580+
self,
581+
revert_public_token: str,
582+
*,
583+
tenant_id: str,
584+
x_revert_api_token: str,
585+
x_api_version: typing.Optional[str] = None,
586+
) -> GetConnectStatusResponse:
587+
"""
588+
Get the OAuth connection event status. This endpoint responds with a `http.ServerResponse` instead of `json`.
589+
590+
Parameters:
591+
- revert_public_token: str.
592+
593+
- tenant_id: str.
594+
595+
- x_revert_api_token: str. Your official API key for accessing revert apis.
596+
597+
- x_api_version: typing.Optional[str]. Optional Revert API version you're using. If missing we default to the latest version of the API.
598+
"""
599+
_response = await self._client_wrapper.httpx_client.request(
600+
"GET",
601+
urllib.parse.urljoin(
602+
f"{self._client_wrapper.get_base_url()}/", f"connection/integration-status/{revert_public_token}"
603+
),
604+
params=remove_none_from_dict({"tenantId": tenant_id}),
605+
headers=remove_none_from_dict(
606+
{
607+
**self._client_wrapper.get_headers(),
608+
"x-revert-api-token": x_revert_api_token,
609+
"x-api-version": x_api_version,
610+
}
611+
),
612+
timeout=None,
613+
)
614+
if 200 <= _response.status_code < 300:
615+
return pydantic.parse_obj_as(GetConnectStatusResponse, _response.json()) # type: ignore
616+
if _response.status_code == 401:
617+
raise UnAuthorizedError(pydantic.parse_obj_as(BaseError, _response.json())) # type: ignore
618+
if _response.status_code == 500:
619+
raise InternalServerError(pydantic.parse_obj_as(BaseError, _response.json())) # type: ignore
620+
try:
621+
_response_json = _response.json()
622+
except JSONDecodeError:
623+
raise ApiError(status_code=_response.status_code, body=_response.text)
624+
raise ApiError(status_code=_response.status_code, body=_response_json)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
# This file was auto-generated by Fern from our API Definition.
22

3+
from .connection_status import ConnectionStatus
34
from .create_connection_webhook_request import CreateConnectionWebhookRequest
45
from .create_connection_webhook_response import CreateConnectionWebhookResponse
56
from .delete_connection_response import DeleteConnectionResponse
67
from .delete_connection_webhook_response import DeleteConnectionWebhookResponse
78
from .get_all_connection_response import GetAllConnectionResponse
9+
from .get_connect_status_response import GetConnectStatusResponse
810
from .get_connection_response import GetConnectionResponse
911
from .get_connection_webhook_response import GetConnectionWebhookResponse
1012

1113
__all__ = [
14+
"ConnectionStatus",
1215
"CreateConnectionWebhookRequest",
1316
"CreateConnectionWebhookResponse",
1417
"DeleteConnectionResponse",
1518
"DeleteConnectionWebhookResponse",
1619
"GetAllConnectionResponse",
20+
"GetConnectStatusResponse",
1721
"GetConnectionResponse",
1822
"GetConnectionWebhookResponse",
1923
]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import enum
4+
import typing
5+
6+
T_Result = typing.TypeVar("T_Result")
7+
8+
9+
class ConnectionStatus(str, enum.Enum):
10+
SUCCESS = "SUCCESS"
11+
FAILED = "FAILED"
12+
13+
def visit(self, success: typing.Callable[[], T_Result], failed: typing.Callable[[], T_Result]) -> T_Result:
14+
if self is ConnectionStatus.SUCCESS:
15+
return success()
16+
if self is ConnectionStatus.FAILED:
17+
return failed()
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import datetime as dt
4+
import typing
5+
6+
from ....core.datetime_utils import serialize_datetime
7+
from .connection_status import ConnectionStatus
8+
9+
try:
10+
import pydantic.v1 as pydantic # type: ignore
11+
except ImportError:
12+
import pydantic # type: ignore
13+
14+
15+
class GetConnectStatusResponse(pydantic.BaseModel):
16+
public_token: str = pydantic.Field(alias="publicToken")
17+
status: ConnectionStatus
18+
integration_name: str = pydantic.Field(alias="integrationName")
19+
tenant_id: str = pydantic.Field(alias="tenantId")
20+
tenant_secret_token: typing.Optional[str] = pydantic.Field(alias="tenantSecretToken")
21+
22+
def json(self, **kwargs: typing.Any) -> str:
23+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
24+
return super().json(**kwargs_with_defaults)
25+
26+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
27+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
28+
return super().dict(**kwargs_with_defaults)
29+
30+
class Config:
31+
frozen = True
32+
smart_union = True
33+
allow_population_by_field_name = True
34+
json_encoders = {dt.datetime: serialize_datetime}

0 commit comments

Comments
 (0)