|
17 | 17 | from .types.delete_connection_response import DeleteConnectionResponse |
18 | 18 | from .types.delete_connection_webhook_response import DeleteConnectionWebhookResponse |
19 | 19 | from .types.get_all_connection_response import GetAllConnectionResponse |
| 20 | +from .types.get_connect_status_response import GetConnectStatusResponse |
20 | 21 | from .types.get_connection_response import GetConnectionResponse |
21 | 22 | from .types.get_connection_webhook_response import GetConnectionWebhookResponse |
22 | 23 |
|
@@ -278,6 +279,53 @@ def delete_webhook( |
278 | 279 | raise ApiError(status_code=_response.status_code, body=_response.text) |
279 | 280 | raise ApiError(status_code=_response.status_code, body=_response_json) |
280 | 281 |
|
| 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 | + |
281 | 329 |
|
282 | 330 | class AsyncConnectionClient: |
283 | 331 | def __init__(self, *, client_wrapper: AsyncClientWrapper): |
@@ -527,3 +575,50 @@ async def delete_webhook( |
527 | 575 | except JSONDecodeError: |
528 | 576 | raise ApiError(status_code=_response.status_code, body=_response.text) |
529 | 577 | 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) |
0 commit comments