Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,27 @@
"filename": "client.py",
"exported_class_name": "Pipedream",
"exported_filename": "pipedream.py"
},
"extra_dependencies": {
"pyjwt": {
"version": ">=2.8.0,<3",
"optional": true
},
"cryptography": {
"version": ">=3.4.0",
"optional": true
}
},
"extras": {
"private-key": [
"pyjwt",
"cryptography"
]
}
},
"originGitCommit": "4ec89179f0cd7c09cc536f40a9c42a089d9cd425",
"originGitCommit": "c2e5677e51c00b8d3b0c89f56c00a2ddadb4c490",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"ciProvider": "github",
"sdkVersion": "2.2.0"
"sdkVersion": "2.3.0"
}
2,765 changes: 2,764 additions & 1 deletion .fern/replay.lock

Large diffs are not rendered by default.

1,320 changes: 705 additions & 615 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dynamic = ["version"]

[tool.poetry]
name = "pipedream"
version = "2.2.0"
version = "2.3.0"
description = ""
readme = "README.md"
authors = []
Expand Down
4 changes: 2 additions & 2 deletions src/pipedream/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ def get_headers(self) -> typing.Dict[str, str]:
import platform

headers: typing.Dict[str, str] = {
"User-Agent": "pipedream/2.2.0",
"User-Agent": "pipedream/2.3.0",
"X-Fern-Language": "Python",
"X-Fern-Runtime": f"python/{platform.python_version()}",
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
"X-Fern-SDK-Name": "pipedream",
"X-Fern-SDK-Version": "2.2.0",
"X-Fern-SDK-Version": "2.3.0",
**(self.get_custom_headers() or {}),
}
if self._project_environment is not None:
Expand Down
104 changes: 104 additions & 0 deletions src/pipedream/deployed_triggers/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,54 @@ def retrieve_webhook(
)
return _response.data

def reset_webhook_delivery_state(
self,
trigger_id: str,
webhook_id: str,
*,
external_user_id: str,
request_options: typing.Optional[RequestOptions] = None,
) -> GetWebhookWithSigningKeyResponse:
"""
Reactivate a disabled webhook and clear its delivery failure evidence

Parameters
----------
trigger_id : str

webhook_id : str

external_user_id : str
The external user ID who owns the trigger

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
GetWebhookWithSigningKeyResponse
webhook delivery state reset

Examples
--------
from pipedream import Pipedream

client = Pipedream(
project_id="YOUR_PROJECT_ID",
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
client.deployed_triggers.reset_webhook_delivery_state(
trigger_id="trigger_id",
webhook_id="webhook_id",
external_user_id="external_user_id",
)
"""
_response = self._raw_client.reset_webhook_delivery_state(
trigger_id, webhook_id, external_user_id=external_user_id, request_options=request_options
)
return _response.data

def regenerate_webhook_signing_key(
self,
trigger_id: str,
Expand Down Expand Up @@ -1179,6 +1227,62 @@ async def main() -> None:
)
return _response.data

async def reset_webhook_delivery_state(
self,
trigger_id: str,
webhook_id: str,
*,
external_user_id: str,
request_options: typing.Optional[RequestOptions] = None,
) -> GetWebhookWithSigningKeyResponse:
"""
Reactivate a disabled webhook and clear its delivery failure evidence

Parameters
----------
trigger_id : str

webhook_id : str

external_user_id : str
The external user ID who owns the trigger

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
GetWebhookWithSigningKeyResponse
webhook delivery state reset

Examples
--------
import asyncio

from pipedream import AsyncPipedream

client = AsyncPipedream(
project_id="YOUR_PROJECT_ID",
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)


async def main() -> None:
await client.deployed_triggers.reset_webhook_delivery_state(
trigger_id="trigger_id",
webhook_id="webhook_id",
external_user_id="external_user_id",
)


asyncio.run(main())
"""
_response = await self._raw_client.reset_webhook_delivery_state(
trigger_id, webhook_id, external_user_id=external_user_id, request_options=request_options
)
return _response.data

async def regenerate_webhook_signing_key(
self,
trigger_id: str,
Expand Down
132 changes: 132 additions & 0 deletions src/pipedream/deployed_triggers/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,72 @@ def retrieve_webhook(
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

def reset_webhook_delivery_state(
self,
trigger_id: str,
webhook_id: str,
*,
external_user_id: str,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[GetWebhookWithSigningKeyResponse]:
"""
Reactivate a disabled webhook and clear its delivery failure evidence

Parameters
----------
trigger_id : str

webhook_id : str

external_user_id : str
The external user ID who owns the trigger

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
HttpResponse[GetWebhookWithSigningKeyResponse]
webhook delivery state reset
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/connect/{encode_path_param(self._client_wrapper._project_id)}/deployed-triggers/{encode_path_param(trigger_id)}/webhooks/{encode_path_param(webhook_id)}/reset_delivery_state",
method="POST",
params={
"external_user_id": external_user_id,
},
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
GetWebhookWithSigningKeyResponse,
parse_obj_as(
type_=GetWebhookWithSigningKeyResponse, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

def regenerate_webhook_signing_key(
self,
trigger_id: str,
Expand Down Expand Up @@ -1519,6 +1585,72 @@ async def retrieve_webhook(
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

async def reset_webhook_delivery_state(
self,
trigger_id: str,
webhook_id: str,
*,
external_user_id: str,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[GetWebhookWithSigningKeyResponse]:
"""
Reactivate a disabled webhook and clear its delivery failure evidence

Parameters
----------
trigger_id : str

webhook_id : str

external_user_id : str
The external user ID who owns the trigger

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
AsyncHttpResponse[GetWebhookWithSigningKeyResponse]
webhook delivery state reset
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/connect/{encode_path_param(self._client_wrapper._project_id)}/deployed-triggers/{encode_path_param(trigger_id)}/webhooks/{encode_path_param(webhook_id)}/reset_delivery_state",
method="POST",
params={
"external_user_id": external_user_id,
},
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
GetWebhookWithSigningKeyResponse,
parse_obj_as(
type_=GetWebhookWithSigningKeyResponse, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

async def regenerate_webhook_signing_key(
self,
trigger_id: str,
Expand Down
4 changes: 3 additions & 1 deletion src/pipedream/errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
from .bad_request_error import BadRequestError
from .not_found_error import NotFoundError
from .too_many_requests_error import TooManyRequestsError
from .unauthorized_error import UnauthorizedError
_dynamic_imports: typing.Dict[str, str] = {
"BadRequestError": ".bad_request_error",
"NotFoundError": ".not_found_error",
"TooManyRequestsError": ".too_many_requests_error",
"UnauthorizedError": ".unauthorized_error",
}


Expand All @@ -37,4 +39,4 @@ def __dir__():
return sorted(lazy_attrs)


__all__ = ["BadRequestError", "NotFoundError", "TooManyRequestsError"]
__all__ = ["BadRequestError", "NotFoundError", "TooManyRequestsError", "UnauthorizedError"]
11 changes: 11 additions & 0 deletions src/pipedream/errors/unauthorized_error.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file was auto-generated by Fern from our API Definition.

import typing

from ..core.api_error import ApiError
from ..types.unauthorized_error_body import UnauthorizedErrorBody


class UnauthorizedError(ApiError):
def __init__(self, body: UnauthorizedErrorBody, headers: typing.Optional[typing.Dict[str, str]] = None):
super().__init__(status_code=401, headers=headers, body=body)
Loading
Loading