Skip to content
Closed
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
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 = "1.1.6"
version = "1.1.7"
description = ""
readme = "README.md"
authors = []
Expand Down
21 changes: 20 additions & 1 deletion src/pipedream/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import typing

import httpx
from .types.project_environment import ProjectEnvironment
from ._.types.project_environment import ProjectEnvironment
from .core.api_error import ApiError
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from .core.oauth_token_provider import AsyncOAuthTokenProvider, OAuthTokenProvider
Expand All @@ -21,6 +21,7 @@
from .deployed_triggers.client import AsyncDeployedTriggersClient, DeployedTriggersClient
from .file_stash.client import AsyncFileStashClient, FileStashClient
from .oauth_tokens.client import AsyncOauthTokensClient, OauthTokensClient
from .project_environment.client import AsyncProjectEnvironmentClient, ProjectEnvironmentClient
from .projects.client import AsyncProjectsClient, ProjectsClient
from .proxy.client import AsyncProxyClient, ProxyClient
from .tokens.client import AsyncTokensClient, TokensClient
Expand Down Expand Up @@ -188,6 +189,7 @@ def __init__(
self._actions: typing.Optional[ActionsClient] = None
self._triggers: typing.Optional[TriggersClient] = None
self._deployed_triggers: typing.Optional[DeployedTriggersClient] = None
self._project_environment: typing.Optional[ProjectEnvironmentClient] = None
self._projects: typing.Optional[ProjectsClient] = None
self._file_stash: typing.Optional[FileStashClient] = None
self._proxy: typing.Optional[ProxyClient] = None
Expand Down Expand Up @@ -259,6 +261,14 @@ def deployed_triggers(self):
self._deployed_triggers = DeployedTriggersClient(client_wrapper=self._client_wrapper)
return self._deployed_triggers

@property
def project_environment(self):
if self._project_environment is None:
from .project_environment.client import ProjectEnvironmentClient # noqa: E402

self._project_environment = ProjectEnvironmentClient(client_wrapper=self._client_wrapper)
return self._project_environment

@property
def projects(self):
if self._projects is None:
Expand Down Expand Up @@ -468,6 +478,7 @@ def __init__(
self._actions: typing.Optional[AsyncActionsClient] = None
self._triggers: typing.Optional[AsyncTriggersClient] = None
self._deployed_triggers: typing.Optional[AsyncDeployedTriggersClient] = None
self._project_environment: typing.Optional[AsyncProjectEnvironmentClient] = None
self._projects: typing.Optional[AsyncProjectsClient] = None
self._file_stash: typing.Optional[AsyncFileStashClient] = None
self._proxy: typing.Optional[AsyncProxyClient] = None
Expand Down Expand Up @@ -539,6 +550,14 @@ def deployed_triggers(self):
self._deployed_triggers = AsyncDeployedTriggersClient(client_wrapper=self._client_wrapper)
return self._deployed_triggers

@property
def project_environment(self):
if self._project_environment is None:
from .project_environment.client import AsyncProjectEnvironmentClient # noqa: E402

self._project_environment = AsyncProjectEnvironmentClient(client_wrapper=self._client_wrapper)
return self._project_environment

@property
def projects(self):
if self._projects is None:
Expand Down
6 changes: 3 additions & 3 deletions src/pipedream/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import typing

import httpx
from ..types.project_environment import ProjectEnvironment
from .._.types.project_environment import ProjectEnvironment
from .http_client import AsyncHttpClient, HttpClient


Expand All @@ -27,10 +27,10 @@ def __init__(

def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"User-Agent": "pipedream/1.1.6",
"User-Agent": "pipedream/1.1.7",
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "pipedream",
"X-Fern-SDK-Version": "1.1.6",
"X-Fern-SDK-Version": "1.1.7",
**(self.get_custom_headers() or {}),
}
if self._project_environment is not None:
Expand Down
217 changes: 215 additions & 2 deletions src/pipedream/deployed_triggers/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from ..types.get_trigger_webhooks_response import GetTriggerWebhooksResponse
from ..types.get_trigger_workflows_response import GetTriggerWorkflowsResponse
from ..types.get_triggers_response import GetTriggersResponse
from ..types.get_webhook_with_signing_key_response import GetWebhookWithSigningKeyResponse
from .raw_client import AsyncRawDeployedTriggersClient, RawDeployedTriggersClient

# this is used as the default value for optional parameters
Expand Down Expand Up @@ -453,7 +454,7 @@ def update_webhooks(
request_options: typing.Optional[RequestOptions] = None,
) -> GetTriggerWebhooksResponse:
"""
Configure webhook URLs to receive trigger events
Configure webhook URLs to receive trigger events. `signing_key` is only returned for OAuth-authenticated requests.

Parameters
----------
Expand Down Expand Up @@ -494,6 +495,104 @@ def update_webhooks(
)
return _response.data

def retrieve_webhook(
self,
trigger_id: str,
webhook_id: str,
*,
external_user_id: str,
request_options: typing.Optional[RequestOptions] = None,
) -> GetWebhookWithSigningKeyResponse:
"""
Retrieve a specific webhook for a deployed trigger, including its signing key

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
trigger webhook retrieved

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

client = Pipedream(
project_id="YOUR_PROJECT_ID",
project_environment="YOUR_PROJECT_ENVIRONMENT",
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
client.deployed_triggers.retrieve_webhook(
trigger_id="trigger_id",
webhook_id="webhook_id",
external_user_id="external_user_id",
)
"""
_response = self._raw_client.retrieve_webhook(
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,
webhook_id: str,
*,
external_user_id: str,
request_options: typing.Optional[RequestOptions] = None,
) -> GetWebhookWithSigningKeyResponse:
"""
Regenerate the signing key for a specific webhook on a deployed trigger

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
signing key regenerated

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

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


class AsyncDeployedTriggersClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
Expand Down Expand Up @@ -995,7 +1094,7 @@ async def update_webhooks(
request_options: typing.Optional[RequestOptions] = None,
) -> GetTriggerWebhooksResponse:
"""
Configure webhook URLs to receive trigger events
Configure webhook URLs to receive trigger events. `signing_key` is only returned for OAuth-authenticated requests.

Parameters
----------
Expand Down Expand Up @@ -1043,3 +1142,117 @@ async def main() -> None:
trigger_id, external_user_id=external_user_id, webhook_urls=webhook_urls, request_options=request_options
)
return _response.data

async def retrieve_webhook(
self,
trigger_id: str,
webhook_id: str,
*,
external_user_id: str,
request_options: typing.Optional[RequestOptions] = None,
) -> GetWebhookWithSigningKeyResponse:
"""
Retrieve a specific webhook for a deployed trigger, including its signing key

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
trigger webhook retrieved

Examples
--------
import asyncio

from pipedream import AsyncPipedream

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


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


asyncio.run(main())
"""
_response = await self._raw_client.retrieve_webhook(
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,
webhook_id: str,
*,
external_user_id: str,
request_options: typing.Optional[RequestOptions] = None,
) -> GetWebhookWithSigningKeyResponse:
"""
Regenerate the signing key for a specific webhook on a deployed trigger

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
signing key regenerated

Examples
--------
import asyncio

from pipedream import AsyncPipedream

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


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


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