diff --git a/README.md b/README.md index 69a6ee4..ea4d0a3 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ client.actions.run( ## Async Client -The SDK also exports an `async` client so that you can make non-blocking calls to our API. +The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client). ```python import asyncio @@ -89,7 +89,14 @@ client = Pipedream( client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) -response = client.apps.list() +response = client.apps.list( + after="after", + before="before", + limit=1, + q="q", + sort_key="name", + sort_direction="asc", +) for item in response: yield item # alternatively, you can paginate page-by-page diff --git a/poetry.lock b/poetry.lock index c2ddd86..9a8863c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -38,13 +38,13 @@ trio = ["trio (>=0.26.1)"] [[package]] name = "certifi" -version = "2025.8.3" +version = "2025.10.5" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" files = [ - {file = "certifi-2025.8.3-py3-none-any.whl", hash = "sha256:f6c12493cfb1b06ba2ff328595af9350c65d6644968e5d3a2ffd78699af217a5"}, - {file = "certifi-2025.8.3.tar.gz", hash = "sha256:e564105f78ded564e3ae7c923924435e1daa7463faeab5bb932bc53ffae63407"}, + {file = "certifi-2025.10.5-py3-none-any.whl", hash = "sha256:0f212c2744a9bb6de0c56639a6f68afe01ecd92d91f14ae897c4fe7bbeeef0de"}, + {file = "certifi-2025.10.5.tar.gz", hash = "sha256:47c09d31ccf2acf0be3f701ea53595ee7e0b8fa08801c6624be771df09ae7b43"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 121e3b7..69392a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "pipedream" [tool.poetry] name = "pipedream" -version = "1.0.8" +version = "1.0.9" description = "" readme = "README.md" authors = [] diff --git a/src/pipedream/accounts/client.py b/src/pipedream/accounts/client.py index 854b919..84f3fdf 100644 --- a/src/pipedream/accounts/client.py +++ b/src/pipedream/accounts/client.py @@ -30,12 +30,12 @@ def with_raw_response(self) -> RawAccountsClient: def list( self, *, - app_id: typing.Optional[str] = None, external_user_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, after: typing.Optional[str] = None, before: typing.Optional[str] = None, limit: typing.Optional[int] = None, + app: typing.Optional[str] = None, include_credentials: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> SyncPager[Account]: @@ -44,9 +44,6 @@ def list( Parameters ---------- - app_id : typing.Optional[str] - The app slug or ID to filter accounts by. - external_user_id : typing.Optional[str] oauth_app_id : typing.Optional[str] @@ -61,6 +58,9 @@ def list( limit : typing.Optional[int] The maximum number of results to return + app : typing.Optional[str] + The app slug or ID to filter accounts by. + include_credentials : typing.Optional[bool] Whether to retrieve the account's credentials or not @@ -82,7 +82,15 @@ def list( client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) - response = client.accounts.list() + response = client.accounts.list( + external_user_id="external_user_id", + oauth_app_id="oauth_app_id", + after="after", + before="before", + limit=1, + app="app", + include_credentials=True, + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -90,12 +98,12 @@ def list( yield page """ return self._raw_client.list( - app_id=app_id, external_user_id=external_user_id, oauth_app_id=oauth_app_id, after=after, before=before, limit=limit, + app=app, include_credentials=include_credentials, request_options=request_options, ) @@ -106,7 +114,6 @@ def create( app_slug: str, cfmap_json: str, connect_token: str, - app_id: typing.Optional[str] = None, external_user_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, name: typing.Optional[str] = OMIT, @@ -126,9 +133,6 @@ def create( connect_token : str The connect token for authentication - app_id : typing.Optional[str] - The app slug or ID to filter accounts by. - external_user_id : typing.Optional[str] oauth_app_id : typing.Optional[str] @@ -156,6 +160,8 @@ def create( client_secret="YOUR_CLIENT_SECRET", ) client.accounts.create( + external_user_id="external_user_id", + oauth_app_id="oauth_app_id", app_slug="app_slug", cfmap_json="cfmap_json", connect_token="connect_token", @@ -165,7 +171,6 @@ def create( app_slug=app_slug, cfmap_json=cfmap_json, connect_token=connect_token, - app_id=app_id, external_user_id=external_user_id, oauth_app_id=oauth_app_id, name=name, @@ -210,6 +215,7 @@ def retrieve( ) client.accounts.retrieve( account_id="account_id", + include_credentials=True, ) """ _response = self._raw_client.retrieve( @@ -300,12 +306,12 @@ def with_raw_response(self) -> AsyncRawAccountsClient: async def list( self, *, - app_id: typing.Optional[str] = None, external_user_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, after: typing.Optional[str] = None, before: typing.Optional[str] = None, limit: typing.Optional[int] = None, + app: typing.Optional[str] = None, include_credentials: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncPager[Account]: @@ -314,9 +320,6 @@ async def list( Parameters ---------- - app_id : typing.Optional[str] - The app slug or ID to filter accounts by. - external_user_id : typing.Optional[str] oauth_app_id : typing.Optional[str] @@ -331,6 +334,9 @@ async def list( limit : typing.Optional[int] The maximum number of results to return + app : typing.Optional[str] + The app slug or ID to filter accounts by. + include_credentials : typing.Optional[bool] Whether to retrieve the account's credentials or not @@ -357,7 +363,15 @@ async def list( async def main() -> None: - response = await client.accounts.list() + response = await client.accounts.list( + external_user_id="external_user_id", + oauth_app_id="oauth_app_id", + after="after", + before="before", + limit=1, + app="app", + include_credentials=True, + ) async for item in response: yield item @@ -369,12 +383,12 @@ async def main() -> None: asyncio.run(main()) """ return await self._raw_client.list( - app_id=app_id, external_user_id=external_user_id, oauth_app_id=oauth_app_id, after=after, before=before, limit=limit, + app=app, include_credentials=include_credentials, request_options=request_options, ) @@ -385,7 +399,6 @@ async def create( app_slug: str, cfmap_json: str, connect_token: str, - app_id: typing.Optional[str] = None, external_user_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, name: typing.Optional[str] = OMIT, @@ -405,9 +418,6 @@ async def create( connect_token : str The connect token for authentication - app_id : typing.Optional[str] - The app slug or ID to filter accounts by. - external_user_id : typing.Optional[str] oauth_app_id : typing.Optional[str] @@ -440,6 +450,8 @@ async def create( async def main() -> None: await client.accounts.create( + external_user_id="external_user_id", + oauth_app_id="oauth_app_id", app_slug="app_slug", cfmap_json="cfmap_json", connect_token="connect_token", @@ -452,7 +464,6 @@ async def main() -> None: app_slug=app_slug, cfmap_json=cfmap_json, connect_token=connect_token, - app_id=app_id, external_user_id=external_user_id, oauth_app_id=oauth_app_id, name=name, @@ -502,6 +513,7 @@ async def retrieve( async def main() -> None: await client.accounts.retrieve( account_id="account_id", + include_credentials=True, ) diff --git a/src/pipedream/accounts/raw_client.py b/src/pipedream/accounts/raw_client.py index 7fffbeb..ac44791 100644 --- a/src/pipedream/accounts/raw_client.py +++ b/src/pipedream/accounts/raw_client.py @@ -25,12 +25,12 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def list( self, *, - app_id: typing.Optional[str] = None, external_user_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, after: typing.Optional[str] = None, before: typing.Optional[str] = None, limit: typing.Optional[int] = None, + app: typing.Optional[str] = None, include_credentials: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> SyncPager[Account]: @@ -39,9 +39,6 @@ def list( Parameters ---------- - app_id : typing.Optional[str] - The app slug or ID to filter accounts by. - external_user_id : typing.Optional[str] oauth_app_id : typing.Optional[str] @@ -56,6 +53,9 @@ def list( limit : typing.Optional[int] The maximum number of results to return + app : typing.Optional[str] + The app slug or ID to filter accounts by. + include_credentials : typing.Optional[bool] Whether to retrieve the account's credentials or not @@ -71,12 +71,12 @@ def list( f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/accounts", method="GET", params={ - "app_id": app_id, "external_user_id": external_user_id, "oauth_app_id": oauth_app_id, "after": after, "before": before, "limit": limit, + "app": app, "include_credentials": include_credentials, }, request_options=request_options, @@ -97,12 +97,12 @@ def list( _parsed_next = _parsed_response.page_info.end_cursor _has_next = _parsed_next is not None and _parsed_next != "" _get_next = lambda: self.list( - app_id=app_id, external_user_id=external_user_id, oauth_app_id=oauth_app_id, after=_parsed_next, before=before, limit=limit, + app=app, include_credentials=include_credentials, request_options=request_options, ) @@ -131,7 +131,6 @@ def create( app_slug: str, cfmap_json: str, connect_token: str, - app_id: typing.Optional[str] = None, external_user_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, name: typing.Optional[str] = OMIT, @@ -151,9 +150,6 @@ def create( connect_token : str The connect token for authentication - app_id : typing.Optional[str] - The app slug or ID to filter accounts by. - external_user_id : typing.Optional[str] oauth_app_id : typing.Optional[str] @@ -174,7 +170,6 @@ def create( f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/accounts", method="POST", params={ - "app_id": app_id, "external_user_id": external_user_id, "oauth_app_id": oauth_app_id, }, @@ -363,12 +358,12 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def list( self, *, - app_id: typing.Optional[str] = None, external_user_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, after: typing.Optional[str] = None, before: typing.Optional[str] = None, limit: typing.Optional[int] = None, + app: typing.Optional[str] = None, include_credentials: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncPager[Account]: @@ -377,9 +372,6 @@ async def list( Parameters ---------- - app_id : typing.Optional[str] - The app slug or ID to filter accounts by. - external_user_id : typing.Optional[str] oauth_app_id : typing.Optional[str] @@ -394,6 +386,9 @@ async def list( limit : typing.Optional[int] The maximum number of results to return + app : typing.Optional[str] + The app slug or ID to filter accounts by. + include_credentials : typing.Optional[bool] Whether to retrieve the account's credentials or not @@ -409,12 +404,12 @@ async def list( f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/accounts", method="GET", params={ - "app_id": app_id, "external_user_id": external_user_id, "oauth_app_id": oauth_app_id, "after": after, "before": before, "limit": limit, + "app": app, "include_credentials": include_credentials, }, request_options=request_options, @@ -437,12 +432,12 @@ async def list( async def _get_next(): return await self.list( - app_id=app_id, external_user_id=external_user_id, oauth_app_id=oauth_app_id, after=_parsed_next, before=before, limit=limit, + app=app, include_credentials=include_credentials, request_options=request_options, ) @@ -472,7 +467,6 @@ async def create( app_slug: str, cfmap_json: str, connect_token: str, - app_id: typing.Optional[str] = None, external_user_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, name: typing.Optional[str] = OMIT, @@ -492,9 +486,6 @@ async def create( connect_token : str The connect token for authentication - app_id : typing.Optional[str] - The app slug or ID to filter accounts by. - external_user_id : typing.Optional[str] oauth_app_id : typing.Optional[str] @@ -515,7 +506,6 @@ async def create( f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/accounts", method="POST", params={ - "app_id": app_id, "external_user_id": external_user_id, "oauth_app_id": oauth_app_id, }, diff --git a/src/pipedream/actions/client.py b/src/pipedream/actions/client.py index a7a44f6..17efbe0 100644 --- a/src/pipedream/actions/client.py +++ b/src/pipedream/actions/client.py @@ -80,7 +80,13 @@ def list( client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) - response = client.actions.list() + response = client.actions.list( + after="after", + before="before", + limit=1, + q="q", + app="app", + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -400,7 +406,13 @@ async def list( async def main() -> None: - response = await client.actions.list() + response = await client.actions.list( + after="after", + before="before", + limit=1, + q="q", + app="app", + ) async for item in response: yield item diff --git a/src/pipedream/apps/__init__.py b/src/pipedream/apps/__init__.py index 28a82cb..3a7655e 100644 --- a/src/pipedream/apps/__init__.py +++ b/src/pipedream/apps/__init__.py @@ -16,8 +16,10 @@ def __getattr__(attr_name: str) -> typing.Any: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) - result = getattr(module, attr_name) - return result + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: diff --git a/src/pipedream/apps/client.py b/src/pipedream/apps/client.py index 5d44a36..512d8df 100644 --- a/src/pipedream/apps/client.py +++ b/src/pipedream/apps/client.py @@ -83,7 +83,14 @@ def list( client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) - response = client.apps.list() + response = client.apps.list( + after="after", + before="before", + limit=1, + q="q", + sort_key="name", + sort_direction="asc", + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -212,7 +219,14 @@ async def list( async def main() -> None: - response = await client.apps.list() + response = await client.apps.list( + after="after", + before="before", + limit=1, + q="q", + sort_key="name", + sort_direction="asc", + ) async for item in response: yield item diff --git a/src/pipedream/apps/types/__init__.py b/src/pipedream/apps/types/__init__.py index a6c7583..08c3a02 100644 --- a/src/pipedream/apps/types/__init__.py +++ b/src/pipedream/apps/types/__init__.py @@ -20,8 +20,10 @@ def __getattr__(attr_name: str) -> typing.Any: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) - result = getattr(module, attr_name) - return result + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: diff --git a/src/pipedream/components/client.py b/src/pipedream/components/client.py index cb6a9c5..1fe5af7 100644 --- a/src/pipedream/components/client.py +++ b/src/pipedream/components/client.py @@ -83,7 +83,14 @@ def list( client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) - response = client.components.list() + response = client.components.list( + after="after", + before="before", + limit=1, + q="q", + app="app", + component_type="trigger", + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -352,7 +359,14 @@ async def list( async def main() -> None: - response = await client.components.list() + response = await client.components.list( + after="after", + before="before", + limit=1, + q="q", + app="app", + component_type="trigger", + ) async for item in response: yield item diff --git a/src/pipedream/core/__init__.py b/src/pipedream/core/__init__.py index f20f6b0..bfce76d 100644 --- a/src/pipedream/core/__init__.py +++ b/src/pipedream/core/__init__.py @@ -64,8 +64,10 @@ def __getattr__(attr_name: str) -> typing.Any: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) - result = getattr(module, attr_name) - return result + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: diff --git a/src/pipedream/core/client_wrapper.py b/src/pipedream/core/client_wrapper.py index 72d55cd..174458c 100644 --- a/src/pipedream/core/client_wrapper.py +++ b/src/pipedream/core/client_wrapper.py @@ -27,10 +27,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "pipedream/1.0.8", + "User-Agent": "pipedream/1.0.9", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "pipedream", - "X-Fern-SDK-Version": "1.0.8", + "X-Fern-SDK-Version": "1.0.9", **(self.get_custom_headers() or {}), } if self._project_environment is not None: diff --git a/src/pipedream/deployed_triggers/client.py b/src/pipedream/deployed_triggers/client.py index 9493eef..2a9e05e 100644 --- a/src/pipedream/deployed_triggers/client.py +++ b/src/pipedream/deployed_triggers/client.py @@ -8,6 +8,7 @@ from ..types.configured_props import ConfiguredProps from ..types.deployed_component import DeployedComponent from ..types.emitted_event import EmittedEvent +from ..types.get_trigger_response_data import GetTriggerResponseData from ..types.get_trigger_webhooks_response import GetTriggerWebhooksResponse from ..types.get_trigger_workflows_response import GetTriggerWorkflowsResponse from .raw_client import AsyncRawDeployedTriggersClient, RawDeployedTriggersClient @@ -76,6 +77,9 @@ def list( client_secret="YOUR_CLIENT_SECRET", ) response = client.deployed_triggers.list( + after="after", + before="before", + limit=1, external_user_id="external_user_id", ) for item in response: @@ -90,7 +94,7 @@ def list( def retrieve( self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None - ) -> DeployedComponent: + ) -> GetTriggerResponseData: """ Get details of a specific deployed trigger by its ID @@ -106,7 +110,7 @@ def retrieve( Returns ------- - DeployedComponent + GetTriggerResponseData deployed trigger retrieved Examples @@ -138,7 +142,7 @@ def update( configured_props: typing.Optional[ConfiguredProps] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> DeployedComponent: + ) -> GetTriggerResponseData: """ Modify the configuration of a deployed trigger, including active status @@ -162,7 +166,7 @@ def update( Returns ------- - DeployedComponent + GetTriggerResponseData deployed trigger updated Examples @@ -231,6 +235,7 @@ def delete( client.deployed_triggers.delete( trigger_id="trigger_id", external_user_id="external_user_id", + ignore_hook_errors=True, ) """ _response = self._raw_client.delete( @@ -283,6 +288,7 @@ def list_events( client.deployed_triggers.list_events( trigger_id="trigger_id", external_user_id="external_user_id", + n=1, ) """ _response = self._raw_client.list_events( @@ -538,6 +544,9 @@ async def list( async def main() -> None: response = await client.deployed_triggers.list( + after="after", + before="before", + limit=1, external_user_id="external_user_id", ) async for item in response: @@ -556,7 +565,7 @@ async def main() -> None: async def retrieve( self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None - ) -> DeployedComponent: + ) -> GetTriggerResponseData: """ Get details of a specific deployed trigger by its ID @@ -572,7 +581,7 @@ async def retrieve( Returns ------- - DeployedComponent + GetTriggerResponseData deployed trigger retrieved Examples @@ -612,7 +621,7 @@ async def update( configured_props: typing.Optional[ConfiguredProps] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> DeployedComponent: + ) -> GetTriggerResponseData: """ Modify the configuration of a deployed trigger, including active status @@ -636,7 +645,7 @@ async def update( Returns ------- - DeployedComponent + GetTriggerResponseData deployed trigger updated Examples @@ -718,6 +727,7 @@ async def main() -> None: await client.deployed_triggers.delete( trigger_id="trigger_id", external_user_id="external_user_id", + ignore_hook_errors=True, ) @@ -778,6 +788,7 @@ async def main() -> None: await client.deployed_triggers.list_events( trigger_id="trigger_id", external_user_id="external_user_id", + n=1, ) diff --git a/src/pipedream/deployed_triggers/raw_client.py b/src/pipedream/deployed_triggers/raw_client.py index 8934c6e..36e78ac 100644 --- a/src/pipedream/deployed_triggers/raw_client.py +++ b/src/pipedream/deployed_triggers/raw_client.py @@ -17,6 +17,7 @@ from ..types.emitted_event import EmittedEvent from ..types.get_trigger_events_response import GetTriggerEventsResponse from ..types.get_trigger_response import GetTriggerResponse +from ..types.get_trigger_response_data import GetTriggerResponseData from ..types.get_trigger_webhooks_response import GetTriggerWebhooksResponse from ..types.get_trigger_workflows_response import GetTriggerWorkflowsResponse from ..types.get_triggers_response import GetTriggersResponse @@ -117,7 +118,7 @@ def list( def retrieve( self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[DeployedComponent]: + ) -> HttpResponse[GetTriggerResponseData]: """ Get details of a specific deployed trigger by its ID @@ -133,7 +134,7 @@ def retrieve( Returns ------- - HttpResponse[DeployedComponent] + HttpResponse[GetTriggerResponseData] deployed trigger retrieved """ _response = self._client_wrapper.httpx_client.request( @@ -180,7 +181,7 @@ def update( configured_props: typing.Optional[ConfiguredProps] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[DeployedComponent]: + ) -> HttpResponse[GetTriggerResponseData]: """ Modify the configuration of a deployed trigger, including active status @@ -204,7 +205,7 @@ def update( Returns ------- - HttpResponse[DeployedComponent] + HttpResponse[GetTriggerResponseData] deployed trigger updated """ _response = self._client_wrapper.httpx_client.request( @@ -720,7 +721,7 @@ async def _get_next(): async def retrieve( self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[DeployedComponent]: + ) -> AsyncHttpResponse[GetTriggerResponseData]: """ Get details of a specific deployed trigger by its ID @@ -736,7 +737,7 @@ async def retrieve( Returns ------- - AsyncHttpResponse[DeployedComponent] + AsyncHttpResponse[GetTriggerResponseData] deployed trigger retrieved """ _response = await self._client_wrapper.httpx_client.request( @@ -783,7 +784,7 @@ async def update( configured_props: typing.Optional[ConfiguredProps] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[DeployedComponent]: + ) -> AsyncHttpResponse[GetTriggerResponseData]: """ Modify the configuration of a deployed trigger, including active status @@ -807,7 +808,7 @@ async def update( Returns ------- - AsyncHttpResponse[DeployedComponent] + AsyncHttpResponse[GetTriggerResponseData] deployed trigger updated """ _response = await self._client_wrapper.httpx_client.request( diff --git a/src/pipedream/errors/__init__.py b/src/pipedream/errors/__init__.py index 32ca4d5..a6d06ac 100644 --- a/src/pipedream/errors/__init__.py +++ b/src/pipedream/errors/__init__.py @@ -16,8 +16,10 @@ def __getattr__(attr_name: str) -> typing.Any: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) - result = getattr(module, attr_name) - return result + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: diff --git a/src/pipedream/file_stash/client.py b/src/pipedream/file_stash/client.py index 4c7ca3f..f0469a8 100644 --- a/src/pipedream/file_stash/client.py +++ b/src/pipedream/file_stash/client.py @@ -22,7 +22,9 @@ def with_raw_response(self) -> RawFileStashClient: """ return self._raw_client - def download_file(self, *, s_3_key: str, request_options: typing.Optional[RequestOptions] = None) -> None: + def download_file( + self, *, s_3_key: str, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Iterator[bytes]: """ Download a file from File Stash @@ -31,11 +33,12 @@ def download_file(self, *, s_3_key: str, request_options: typing.Optional[Reques s_3_key : str request_options : typing.Optional[RequestOptions] - Request-specific configuration. + Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- - None + typing.Iterator[bytes] + file contents Examples -------- @@ -51,8 +54,8 @@ def download_file(self, *, s_3_key: str, request_options: typing.Optional[Reques s_3_key="s3_key", ) """ - _response = self._raw_client.download_file(s_3_key=s_3_key, request_options=request_options) - return _response.data + with self._raw_client.download_file(s_3_key=s_3_key, request_options=request_options) as r: + yield from r.data class AsyncFileStashClient: @@ -70,7 +73,9 @@ def with_raw_response(self) -> AsyncRawFileStashClient: """ return self._raw_client - async def download_file(self, *, s_3_key: str, request_options: typing.Optional[RequestOptions] = None) -> None: + async def download_file( + self, *, s_3_key: str, request_options: typing.Optional[RequestOptions] = None + ) -> typing.AsyncIterator[bytes]: """ Download a file from File Stash @@ -79,11 +84,12 @@ async def download_file(self, *, s_3_key: str, request_options: typing.Optional[ s_3_key : str request_options : typing.Optional[RequestOptions] - Request-specific configuration. + Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- - None + typing.AsyncIterator[bytes] + file contents Examples -------- @@ -107,5 +113,6 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.download_file(s_3_key=s_3_key, request_options=request_options) - return _response.data + async with self._raw_client.download_file(s_3_key=s_3_key, request_options=request_options) as r: + async for _chunk in r.data: + yield _chunk diff --git a/src/pipedream/file_stash/raw_client.py b/src/pipedream/file_stash/raw_client.py index 17ae805..0a4d576 100644 --- a/src/pipedream/file_stash/raw_client.py +++ b/src/pipedream/file_stash/raw_client.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import contextlib import typing from json.decoder import JSONDecodeError @@ -16,9 +17,10 @@ class RawFileStashClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + @contextlib.contextmanager def download_file( self, *, s_3_key: str, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[None]: + ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Download a file from File Stash @@ -27,47 +29,59 @@ def download_file( s_3_key : str request_options : typing.Optional[RequestOptions] - Request-specific configuration. + Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- - HttpResponse[None] + typing.Iterator[HttpResponse[typing.Iterator[bytes]]] + file contents """ - _response = self._client_wrapper.httpx_client.request( + with self._client_wrapper.httpx_client.stream( f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/file_stash/download", method="GET", params={ "s3_key": s_3_key, }, request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return HttpResponse(response=_response, data=None) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Optional[typing.Any], - parse_obj_as( - type_=typing.Optional[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) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + ) as _response: + + def _stream() -> HttpResponse[typing.Iterator[bytes]]: + try: + if 200 <= _response.status_code < 300: + _chunk_size = request_options.get("chunk_size", None) if request_options is not None else None + return HttpResponse( + response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) + ) + _response.read() + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[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 + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + yield _stream() class AsyncRawFileStashClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper + @contextlib.asynccontextmanager async def download_file( self, *, s_3_key: str, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[None]: + ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Download a file from File Stash @@ -76,35 +90,47 @@ async def download_file( s_3_key : str request_options : typing.Optional[RequestOptions] - Request-specific configuration. + Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- - AsyncHttpResponse[None] + typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] + file contents """ - _response = await self._client_wrapper.httpx_client.request( + async with self._client_wrapper.httpx_client.stream( f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/file_stash/download", method="GET", params={ "s3_key": s_3_key, }, request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return AsyncHttpResponse(response=_response, data=None) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Optional[typing.Any], - parse_obj_as( - type_=typing.Optional[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) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + ) as _response: + + async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: + try: + if 200 <= _response.status_code < 300: + _chunk_size = request_options.get("chunk_size", None) if request_options is not None else None + return AsyncHttpResponse( + response=_response, + data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), + ) + await _response.aread() + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[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 + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + yield await _stream() diff --git a/src/pipedream/tokens/client.py b/src/pipedream/tokens/client.py index cbe1c64..f37eccf 100644 --- a/src/pipedream/tokens/client.py +++ b/src/pipedream/tokens/client.py @@ -132,6 +132,7 @@ def validate( client.tokens.validate( ctok="ctok", app_id="app_id", + oauth_app_id="oauth_app_id", ) """ _response = self._raw_client.validate( @@ -272,6 +273,7 @@ async def main() -> None: await client.tokens.validate( ctok="ctok", app_id="app_id", + oauth_app_id="oauth_app_id", ) diff --git a/src/pipedream/triggers/client.py b/src/pipedream/triggers/client.py index 32bf25d..faf4a2a 100644 --- a/src/pipedream/triggers/client.py +++ b/src/pipedream/triggers/client.py @@ -8,7 +8,7 @@ from ..types.component import Component from ..types.configure_prop_response import ConfigurePropResponse from ..types.configured_props import ConfiguredProps -from ..types.deployed_component import DeployedComponent +from ..types.deploy_trigger_response_data import DeployTriggerResponseData from ..types.reload_props_response import ReloadPropsResponse from .raw_client import AsyncRawTriggersClient, RawTriggersClient @@ -79,7 +79,13 @@ def list( client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) - response = client.triggers.list() + response = client.triggers.list( + after="after", + before="before", + limit=1, + q="q", + app="app", + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -278,7 +284,7 @@ def deploy( dynamic_props_id: typing.Optional[str] = OMIT, webhook_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> DeployedComponent: + ) -> DeployTriggerResponseData: """ Deploy a trigger to listen for and emit events @@ -303,7 +309,7 @@ def deploy( Returns ------- - DeployedComponent + DeployTriggerResponseData trigger deployed Examples @@ -400,7 +406,13 @@ async def list( async def main() -> None: - response = await client.triggers.list() + response = await client.triggers.list( + after="after", + before="before", + limit=1, + q="q", + app="app", + ) async for item in response: yield item @@ -629,7 +641,7 @@ async def deploy( dynamic_props_id: typing.Optional[str] = OMIT, webhook_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> DeployedComponent: + ) -> DeployTriggerResponseData: """ Deploy a trigger to listen for and emit events @@ -654,7 +666,7 @@ async def deploy( Returns ------- - DeployedComponent + DeployTriggerResponseData trigger deployed Examples diff --git a/src/pipedream/triggers/raw_client.py b/src/pipedream/triggers/raw_client.py index faf7bee..abeb4de 100644 --- a/src/pipedream/triggers/raw_client.py +++ b/src/pipedream/triggers/raw_client.py @@ -16,7 +16,7 @@ from ..types.configure_prop_response import ConfigurePropResponse from ..types.configured_props import ConfiguredProps from ..types.deploy_trigger_response import DeployTriggerResponse -from ..types.deployed_component import DeployedComponent +from ..types.deploy_trigger_response_data import DeployTriggerResponseData from ..types.get_component_response import GetComponentResponse from ..types.get_components_response import GetComponentsResponse from ..types.reload_props_response import ReloadPropsResponse @@ -363,7 +363,7 @@ def deploy( dynamic_props_id: typing.Optional[str] = OMIT, webhook_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[DeployedComponent]: + ) -> HttpResponse[DeployTriggerResponseData]: """ Deploy a trigger to listen for and emit events @@ -388,7 +388,7 @@ def deploy( Returns ------- - HttpResponse[DeployedComponent] + HttpResponse[DeployTriggerResponseData] trigger deployed """ _response = self._client_wrapper.httpx_client.request( @@ -778,7 +778,7 @@ async def deploy( dynamic_props_id: typing.Optional[str] = OMIT, webhook_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[DeployedComponent]: + ) -> AsyncHttpResponse[DeployTriggerResponseData]: """ Deploy a trigger to listen for and emit events @@ -803,7 +803,7 @@ async def deploy( Returns ------- - AsyncHttpResponse[DeployedComponent] + AsyncHttpResponse[DeployTriggerResponseData] trigger deployed """ _response = await self._client_wrapper.httpx_client.request( diff --git a/src/pipedream/types/__init__.py b/src/pipedream/types/__init__.py index 535fbf0..e88ab8c 100644 --- a/src/pipedream/types/__init__.py +++ b/src/pipedream/types/__init__.py @@ -24,9 +24,11 @@ from .configurable_prop_alert import ConfigurablePropAlert from .configurable_prop_alert_type import ConfigurablePropAlertType from .configurable_prop_any import ConfigurablePropAny + from .configurable_prop_any_options_item import ConfigurablePropAnyOptionsItem from .configurable_prop_app import ConfigurablePropApp from .configurable_prop_apphook import ConfigurablePropApphook from .configurable_prop_boolean import ConfigurablePropBoolean + from .configurable_prop_boolean_options_item import ConfigurablePropBooleanOptionsItem from .configurable_prop_db import ConfigurablePropDb from .configurable_prop_discord import ConfigurablePropDiscord from .configurable_prop_discord_channel import ConfigurablePropDiscordChannel @@ -34,11 +36,17 @@ from .configurable_prop_http import ConfigurablePropHttp from .configurable_prop_integer import ConfigurablePropInteger from .configurable_prop_integer_array import ConfigurablePropIntegerArray + from .configurable_prop_integer_array_options_item import ConfigurablePropIntegerArrayOptionsItem + from .configurable_prop_integer_options_item import ConfigurablePropIntegerOptionsItem from .configurable_prop_object import ConfigurablePropObject + from .configurable_prop_object_options_item import ConfigurablePropObjectOptionsItem from .configurable_prop_sql import ConfigurablePropSql from .configurable_prop_sql_auth import ConfigurablePropSqlAuth + from .configurable_prop_sql_options_item import ConfigurablePropSqlOptionsItem from .configurable_prop_string import ConfigurablePropString from .configurable_prop_string_array import ConfigurablePropStringArray + from .configurable_prop_string_array_options_item import ConfigurablePropStringArrayOptionsItem + from .configurable_prop_string_options_item import ConfigurablePropStringOptionsItem from .configurable_prop_timer import ConfigurablePropTimer from .configurable_prop_timer_default import ConfigurablePropTimerDefault from .configurable_prop_timer_option import ConfigurablePropTimerOption @@ -63,6 +71,7 @@ from .create_token_response import CreateTokenResponse from .delete_trigger_opts import DeleteTriggerOpts from .deploy_trigger_response import DeployTriggerResponse + from .deploy_trigger_response_data import DeployTriggerResponseData from .deployed_component import DeployedComponent from .dynamic_props import DynamicProps from .emitted_event import EmittedEvent @@ -75,9 +84,11 @@ from .get_components_response import GetComponentsResponse from .get_trigger_events_response import GetTriggerEventsResponse from .get_trigger_response import GetTriggerResponse + from .get_trigger_response_data import GetTriggerResponseData from .get_trigger_webhooks_response import GetTriggerWebhooksResponse from .get_trigger_workflows_response import GetTriggerWorkflowsResponse from .get_triggers_response import GetTriggersResponse + from .http_interface import HttpInterface from .list_accounts_response import ListAccountsResponse from .list_app_categories_response import ListAppCategoriesResponse from .list_apps_response import ListAppsResponse @@ -98,8 +109,10 @@ from .start_connect_opts import StartConnectOpts from .stash_id import StashId from .timer_cron import TimerCron + from .timer_interface import TimerInterface from .timer_interval import TimerInterval from .too_many_requests_error_body import TooManyRequestsErrorBody + from .tool_annotations import ToolAnnotations from .validate_token_response import ValidateTokenResponse _dynamic_imports: typing.Dict[str, str] = { "Account": ".account", @@ -120,9 +133,11 @@ "ConfigurablePropAlert": ".configurable_prop_alert", "ConfigurablePropAlertType": ".configurable_prop_alert_type", "ConfigurablePropAny": ".configurable_prop_any", + "ConfigurablePropAnyOptionsItem": ".configurable_prop_any_options_item", "ConfigurablePropApp": ".configurable_prop_app", "ConfigurablePropApphook": ".configurable_prop_apphook", "ConfigurablePropBoolean": ".configurable_prop_boolean", + "ConfigurablePropBooleanOptionsItem": ".configurable_prop_boolean_options_item", "ConfigurablePropDb": ".configurable_prop_db", "ConfigurablePropDiscord": ".configurable_prop_discord", "ConfigurablePropDiscordChannel": ".configurable_prop_discord_channel", @@ -130,11 +145,17 @@ "ConfigurablePropHttp": ".configurable_prop_http", "ConfigurablePropInteger": ".configurable_prop_integer", "ConfigurablePropIntegerArray": ".configurable_prop_integer_array", + "ConfigurablePropIntegerArrayOptionsItem": ".configurable_prop_integer_array_options_item", + "ConfigurablePropIntegerOptionsItem": ".configurable_prop_integer_options_item", "ConfigurablePropObject": ".configurable_prop_object", + "ConfigurablePropObjectOptionsItem": ".configurable_prop_object_options_item", "ConfigurablePropSql": ".configurable_prop_sql", "ConfigurablePropSqlAuth": ".configurable_prop_sql_auth", + "ConfigurablePropSqlOptionsItem": ".configurable_prop_sql_options_item", "ConfigurablePropString": ".configurable_prop_string", "ConfigurablePropStringArray": ".configurable_prop_string_array", + "ConfigurablePropStringArrayOptionsItem": ".configurable_prop_string_array_options_item", + "ConfigurablePropStringOptionsItem": ".configurable_prop_string_options_item", "ConfigurablePropTimer": ".configurable_prop_timer", "ConfigurablePropTimerDefault": ".configurable_prop_timer_default", "ConfigurablePropTimerOption": ".configurable_prop_timer_option", @@ -159,6 +180,7 @@ "CreateTokenResponse": ".create_token_response", "DeleteTriggerOpts": ".delete_trigger_opts", "DeployTriggerResponse": ".deploy_trigger_response", + "DeployTriggerResponseData": ".deploy_trigger_response_data", "DeployedComponent": ".deployed_component", "DynamicProps": ".dynamic_props", "EmittedEvent": ".emitted_event", @@ -171,9 +193,11 @@ "GetComponentsResponse": ".get_components_response", "GetTriggerEventsResponse": ".get_trigger_events_response", "GetTriggerResponse": ".get_trigger_response", + "GetTriggerResponseData": ".get_trigger_response_data", "GetTriggerWebhooksResponse": ".get_trigger_webhooks_response", "GetTriggerWorkflowsResponse": ".get_trigger_workflows_response", "GetTriggersResponse": ".get_triggers_response", + "HttpInterface": ".http_interface", "ListAccountsResponse": ".list_accounts_response", "ListAppCategoriesResponse": ".list_app_categories_response", "ListAppsResponse": ".list_apps_response", @@ -194,8 +218,10 @@ "StartConnectOpts": ".start_connect_opts", "StashId": ".stash_id", "TimerCron": ".timer_cron", + "TimerInterface": ".timer_interface", "TimerInterval": ".timer_interval", "TooManyRequestsErrorBody": ".too_many_requests_error_body", + "ToolAnnotations": ".tool_annotations", "ValidateTokenResponse": ".validate_token_response", } @@ -206,8 +232,10 @@ def __getattr__(attr_name: str) -> typing.Any: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) - result = getattr(module, attr_name) - return result + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: @@ -238,9 +266,11 @@ def __dir__(): "ConfigurablePropAlert", "ConfigurablePropAlertType", "ConfigurablePropAny", + "ConfigurablePropAnyOptionsItem", "ConfigurablePropApp", "ConfigurablePropApphook", "ConfigurablePropBoolean", + "ConfigurablePropBooleanOptionsItem", "ConfigurablePropDb", "ConfigurablePropDiscord", "ConfigurablePropDiscordChannel", @@ -248,11 +278,17 @@ def __dir__(): "ConfigurablePropHttp", "ConfigurablePropInteger", "ConfigurablePropIntegerArray", + "ConfigurablePropIntegerArrayOptionsItem", + "ConfigurablePropIntegerOptionsItem", "ConfigurablePropObject", + "ConfigurablePropObjectOptionsItem", "ConfigurablePropSql", "ConfigurablePropSqlAuth", + "ConfigurablePropSqlOptionsItem", "ConfigurablePropString", "ConfigurablePropStringArray", + "ConfigurablePropStringArrayOptionsItem", + "ConfigurablePropStringOptionsItem", "ConfigurablePropTimer", "ConfigurablePropTimerDefault", "ConfigurablePropTimerOption", @@ -277,6 +313,7 @@ def __dir__(): "CreateTokenResponse", "DeleteTriggerOpts", "DeployTriggerResponse", + "DeployTriggerResponseData", "DeployedComponent", "DynamicProps", "EmittedEvent", @@ -289,9 +326,11 @@ def __dir__(): "GetComponentsResponse", "GetTriggerEventsResponse", "GetTriggerResponse", + "GetTriggerResponseData", "GetTriggerWebhooksResponse", "GetTriggerWorkflowsResponse", "GetTriggersResponse", + "HttpInterface", "ListAccountsResponse", "ListAppCategoriesResponse", "ListAppsResponse", @@ -312,7 +351,9 @@ def __dir__(): "StartConnectOpts", "StashId", "TimerCron", + "TimerInterface", "TimerInterval", "TooManyRequestsErrorBody", + "ToolAnnotations", "ValidateTokenResponse", ] diff --git a/src/pipedream/types/component.py b/src/pipedream/types/component.py index 5ea1ff2..d707695 100644 --- a/src/pipedream/types/component.py +++ b/src/pipedream/types/component.py @@ -6,6 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .component_stash import ComponentStash from .configurable_prop import ConfigurableProp +from .tool_annotations import ToolAnnotations class Component(UniversalBaseModel): @@ -36,6 +37,7 @@ class Component(UniversalBaseModel): """ stash: typing.Optional[ComponentStash] = None + annotations: typing.Optional[ToolAnnotations] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/pipedream/types/configurable_prop_any.py b/src/pipedream/types/configurable_prop_any.py index 2b1fe36..dff60a9 100644 --- a/src/pipedream/types/configurable_prop_any.py +++ b/src/pipedream/types/configurable_prop_any.py @@ -6,10 +6,14 @@ import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ..core.serialization import FieldMetadata +from .configurable_prop_any_options_item import ConfigurablePropAnyOptionsItem +from .configured_prop_value_any import ConfiguredPropValueAny class ConfigurablePropAny(UniversalBaseModel): type: typing.Literal["any"] = "any" + default: typing.Optional[ConfiguredPropValueAny] = None + options: typing.Optional[typing.List[ConfigurablePropAnyOptionsItem]] = None name: str = pydantic.Field() """ When building `configuredProps`, make sure to use this field as the key when setting the prop value diff --git a/src/pipedream/types/configurable_prop_any_options_item.py b/src/pipedream/types/configurable_prop_any_options_item.py new file mode 100644 index 0000000..5821fa9 --- /dev/null +++ b/src/pipedream/types/configurable_prop_any_options_item.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .prop_option import PropOption +from .prop_option_nested import PropOptionNested +from .prop_option_value import PropOptionValue + +ConfigurablePropAnyOptionsItem = typing.Union[PropOption, PropOptionNested, typing.Optional[PropOptionValue]] diff --git a/src/pipedream/types/configurable_prop_boolean.py b/src/pipedream/types/configurable_prop_boolean.py index 79c8bc5..649ef51 100644 --- a/src/pipedream/types/configurable_prop_boolean.py +++ b/src/pipedream/types/configurable_prop_boolean.py @@ -6,15 +6,14 @@ import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ..core.serialization import FieldMetadata +from .configurable_prop_boolean_options_item import ConfigurablePropBooleanOptionsItem +from .configured_prop_value_boolean import ConfiguredPropValueBoolean class ConfigurablePropBoolean(UniversalBaseModel): type: typing.Literal["boolean"] = "boolean" - default: typing.Optional[bool] = pydantic.Field(default=None) - """ - The default value for this prop - """ - + default: typing.Optional[ConfiguredPropValueBoolean] = None + options: typing.Optional[typing.List[ConfigurablePropBooleanOptionsItem]] = None name: str = pydantic.Field() """ When building `configuredProps`, make sure to use this field as the key when setting the prop value diff --git a/src/pipedream/types/configurable_prop_boolean_options_item.py b/src/pipedream/types/configurable_prop_boolean_options_item.py new file mode 100644 index 0000000..42816c7 --- /dev/null +++ b/src/pipedream/types/configurable_prop_boolean_options_item.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .prop_option import PropOption +from .prop_option_nested import PropOptionNested +from .prop_option_value import PropOptionValue + +ConfigurablePropBooleanOptionsItem = typing.Union[PropOption, PropOptionNested, typing.Optional[PropOptionValue]] diff --git a/src/pipedream/types/configurable_prop_integer.py b/src/pipedream/types/configurable_prop_integer.py index 557a182..a19f6f0 100644 --- a/src/pipedream/types/configurable_prop_integer.py +++ b/src/pipedream/types/configurable_prop_integer.py @@ -6,6 +6,8 @@ import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ..core.serialization import FieldMetadata +from .configurable_prop_integer_options_item import ConfigurablePropIntegerOptionsItem +from .configured_prop_value_integer import ConfiguredPropValueInteger class ConfigurablePropInteger(UniversalBaseModel): @@ -20,12 +22,8 @@ class ConfigurablePropInteger(UniversalBaseModel): The maximum value for this integer prop. """ - default: typing.Optional[int] = pydantic.Field(default=None) - """ - Default integer value - """ - - options: typing.Optional[typing.List[int]] = pydantic.Field(default=None) + default: typing.Optional[ConfiguredPropValueInteger] = None + options: typing.Optional[typing.List[ConfigurablePropIntegerOptionsItem]] = pydantic.Field(default=None) """ Available integer options """ diff --git a/src/pipedream/types/configurable_prop_integer_array.py b/src/pipedream/types/configurable_prop_integer_array.py index d06dd4a..4e39ff4 100644 --- a/src/pipedream/types/configurable_prop_integer_array.py +++ b/src/pipedream/types/configurable_prop_integer_array.py @@ -6,6 +6,8 @@ import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ..core.serialization import FieldMetadata +from .configurable_prop_integer_array_options_item import ConfigurablePropIntegerArrayOptionsItem +from .configured_prop_value_integer import ConfiguredPropValueInteger class ConfigurablePropIntegerArray(UniversalBaseModel): @@ -20,12 +22,12 @@ class ConfigurablePropIntegerArray(UniversalBaseModel): The maximum value for integers in this array """ - default: typing.Optional[typing.List[int]] = pydantic.Field(default=None) + default: typing.Optional[typing.List[ConfiguredPropValueInteger]] = pydantic.Field(default=None) """ Default array of integers """ - options: typing.Optional[typing.List[int]] = pydantic.Field(default=None) + options: typing.Optional[typing.List[ConfigurablePropIntegerArrayOptionsItem]] = pydantic.Field(default=None) """ Available options for the integer array """ diff --git a/src/pipedream/types/configurable_prop_integer_array_options_item.py b/src/pipedream/types/configurable_prop_integer_array_options_item.py new file mode 100644 index 0000000..5964a7f --- /dev/null +++ b/src/pipedream/types/configurable_prop_integer_array_options_item.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .prop_option import PropOption +from .prop_option_nested import PropOptionNested +from .prop_option_value import PropOptionValue + +ConfigurablePropIntegerArrayOptionsItem = typing.Union[PropOption, PropOptionNested, typing.Optional[PropOptionValue]] diff --git a/src/pipedream/types/configurable_prop_integer_options_item.py b/src/pipedream/types/configurable_prop_integer_options_item.py new file mode 100644 index 0000000..731b611 --- /dev/null +++ b/src/pipedream/types/configurable_prop_integer_options_item.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .prop_option import PropOption +from .prop_option_nested import PropOptionNested +from .prop_option_value import PropOptionValue + +ConfigurablePropIntegerOptionsItem = typing.Union[PropOption, PropOptionNested, typing.Optional[PropOptionValue]] diff --git a/src/pipedream/types/configurable_prop_object.py b/src/pipedream/types/configurable_prop_object.py index f4c6cb2..5be13ea 100644 --- a/src/pipedream/types/configurable_prop_object.py +++ b/src/pipedream/types/configurable_prop_object.py @@ -6,10 +6,14 @@ import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ..core.serialization import FieldMetadata +from .configurable_prop_object_options_item import ConfigurablePropObjectOptionsItem +from .configured_prop_value_object import ConfiguredPropValueObject class ConfigurablePropObject(UniversalBaseModel): type: typing.Literal["object"] = "object" + default: typing.Optional[ConfiguredPropValueObject] = None + options: typing.Optional[typing.List[ConfigurablePropObjectOptionsItem]] = None name: str = pydantic.Field() """ When building `configuredProps`, make sure to use this field as the key when setting the prop value diff --git a/src/pipedream/types/configurable_prop_object_options_item.py b/src/pipedream/types/configurable_prop_object_options_item.py new file mode 100644 index 0000000..599ee27 --- /dev/null +++ b/src/pipedream/types/configurable_prop_object_options_item.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .prop_option import PropOption +from .prop_option_nested import PropOptionNested +from .prop_option_value import PropOptionValue + +ConfigurablePropObjectOptionsItem = typing.Union[PropOption, PropOptionNested, typing.Optional[PropOptionValue]] diff --git a/src/pipedream/types/configurable_prop_sql.py b/src/pipedream/types/configurable_prop_sql.py index 1537845..6c13cf3 100644 --- a/src/pipedream/types/configurable_prop_sql.py +++ b/src/pipedream/types/configurable_prop_sql.py @@ -7,16 +7,15 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ..core.serialization import FieldMetadata from .configurable_prop_sql_auth import ConfigurablePropSqlAuth +from .configurable_prop_sql_options_item import ConfigurablePropSqlOptionsItem +from .configured_prop_value_sql import ConfiguredPropValueSql class ConfigurablePropSql(UniversalBaseModel): type: typing.Literal["sql"] = "sql" auth: typing.Optional[ConfigurablePropSqlAuth] = None - default: typing.Optional[str] = pydantic.Field(default=None) - """ - Default SQL query - """ - + default: typing.Optional[ConfiguredPropValueSql] = None + options: typing.Optional[typing.List[ConfigurablePropSqlOptionsItem]] = None name: str = pydantic.Field() """ When building `configuredProps`, make sure to use this field as the key when setting the prop value diff --git a/src/pipedream/types/configurable_prop_sql_options_item.py b/src/pipedream/types/configurable_prop_sql_options_item.py new file mode 100644 index 0000000..1fa22eb --- /dev/null +++ b/src/pipedream/types/configurable_prop_sql_options_item.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .prop_option import PropOption +from .prop_option_nested import PropOptionNested +from .prop_option_value import PropOptionValue + +ConfigurablePropSqlOptionsItem = typing.Union[PropOption, PropOptionNested, typing.Optional[PropOptionValue]] diff --git a/src/pipedream/types/configurable_prop_string.py b/src/pipedream/types/configurable_prop_string.py index 2aa20b3..dee9dc5 100644 --- a/src/pipedream/types/configurable_prop_string.py +++ b/src/pipedream/types/configurable_prop_string.py @@ -6,20 +6,19 @@ import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ..core.serialization import FieldMetadata +from .configurable_prop_string_options_item import ConfigurablePropStringOptionsItem +from .configured_prop_value_string import ConfiguredPropValueString class ConfigurablePropString(UniversalBaseModel): type: typing.Literal["string"] = "string" - default: typing.Optional[str] = pydantic.Field(default=None) - """ - The default value for this prop - """ - secret: typing.Optional[bool] = pydantic.Field(default=None) """ If true, this prop is a secret and should not be displayed in plain text. """ + default: typing.Optional[ConfiguredPropValueString] = None + options: typing.Optional[typing.List[ConfigurablePropStringOptionsItem]] = None name: str = pydantic.Field() """ When building `configuredProps`, make sure to use this field as the key when setting the prop value diff --git a/src/pipedream/types/configurable_prop_string_array.py b/src/pipedream/types/configurable_prop_string_array.py index ecc8766..e6a1302 100644 --- a/src/pipedream/types/configurable_prop_string_array.py +++ b/src/pipedream/types/configurable_prop_string_array.py @@ -6,20 +6,23 @@ import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ..core.serialization import FieldMetadata +from .configurable_prop_string_array_options_item import ConfigurablePropStringArrayOptionsItem +from .configured_prop_value_string import ConfiguredPropValueString class ConfigurablePropStringArray(UniversalBaseModel): type: typing.Literal["string[]"] = "string[]" - default: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + secret: typing.Optional[bool] = pydantic.Field(default=None) """ - The default value for this prop + If true, this prop is a secret and should not be displayed in plain text. """ - secret: typing.Optional[bool] = pydantic.Field(default=None) + default: typing.Optional[typing.List[ConfiguredPropValueString]] = pydantic.Field(default=None) """ - If true, this prop is a secret and should not be displayed in plain text. + The default value for this prop """ + options: typing.Optional[typing.List[ConfigurablePropStringArrayOptionsItem]] = None name: str = pydantic.Field() """ When building `configuredProps`, make sure to use this field as the key when setting the prop value diff --git a/src/pipedream/types/configurable_prop_string_array_options_item.py b/src/pipedream/types/configurable_prop_string_array_options_item.py new file mode 100644 index 0000000..28de653 --- /dev/null +++ b/src/pipedream/types/configurable_prop_string_array_options_item.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .prop_option import PropOption +from .prop_option_nested import PropOptionNested +from .prop_option_value import PropOptionValue + +ConfigurablePropStringArrayOptionsItem = typing.Union[PropOption, PropOptionNested, typing.Optional[PropOptionValue]] diff --git a/src/pipedream/types/configurable_prop_string_options_item.py b/src/pipedream/types/configurable_prop_string_options_item.py new file mode 100644 index 0000000..53bcc2e --- /dev/null +++ b/src/pipedream/types/configurable_prop_string_options_item.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .prop_option import PropOption +from .prop_option_nested import PropOptionNested +from .prop_option_value import PropOptionValue + +ConfigurablePropStringOptionsItem = typing.Union[PropOption, PropOptionNested, typing.Optional[PropOptionValue]] diff --git a/src/pipedream/types/deploy_trigger_response.py b/src/pipedream/types/deploy_trigger_response.py index bdb7143..3ef2b0b 100644 --- a/src/pipedream/types/deploy_trigger_response.py +++ b/src/pipedream/types/deploy_trigger_response.py @@ -4,7 +4,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .deployed_component import DeployedComponent +from .deploy_trigger_response_data import DeployTriggerResponseData class DeployTriggerResponse(UniversalBaseModel): @@ -12,7 +12,7 @@ class DeployTriggerResponse(UniversalBaseModel): Response received after deploying a trigger """ - data: DeployedComponent + data: DeployTriggerResponseData if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/pipedream/types/deploy_trigger_response_data.py b/src/pipedream/types/deploy_trigger_response_data.py new file mode 100644 index 0000000..3a175e2 --- /dev/null +++ b/src/pipedream/types/deploy_trigger_response_data.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .deployed_component import DeployedComponent +from .http_interface import HttpInterface +from .timer_interface import TimerInterface + +DeployTriggerResponseData = typing.Union[DeployedComponent, HttpInterface, TimerInterface] diff --git a/src/pipedream/types/get_trigger_response.py b/src/pipedream/types/get_trigger_response.py index d97f5e3..977f20e 100644 --- a/src/pipedream/types/get_trigger_response.py +++ b/src/pipedream/types/get_trigger_response.py @@ -4,7 +4,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .deployed_component import DeployedComponent +from .get_trigger_response_data import GetTriggerResponseData class GetTriggerResponse(UniversalBaseModel): @@ -12,7 +12,7 @@ class GetTriggerResponse(UniversalBaseModel): Response received when retrieving a deployed trigger """ - data: DeployedComponent + data: GetTriggerResponseData if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/pipedream/types/get_trigger_response_data.py b/src/pipedream/types/get_trigger_response_data.py new file mode 100644 index 0000000..5817054 --- /dev/null +++ b/src/pipedream/types/get_trigger_response_data.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .deployed_component import DeployedComponent +from .http_interface import HttpInterface +from .timer_interface import TimerInterface + +GetTriggerResponseData = typing.Union[DeployedComponent, HttpInterface, TimerInterface] diff --git a/src/pipedream/types/http_interface.py b/src/pipedream/types/http_interface.py new file mode 100644 index 0000000..7c32c5f --- /dev/null +++ b/src/pipedream/types/http_interface.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class HttpInterface(UniversalBaseModel): + """ + An HTTP interface instance + """ + + id: str = pydantic.Field() + """ + The unique ID of the HTTP interface + """ + + key: str + endpoint_url: str + custom_response: bool + created_at: int = pydantic.Field() + """ + The timestamp when the HTTP interface was created (epoch milliseconds) + """ + + updated_at: typing.Optional[int] = pydantic.Field(default=None) + """ + The timestamp when the HTTP interface was last updated (epoch milliseconds) + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/pipedream/types/timer_interface.py b/src/pipedream/types/timer_interface.py new file mode 100644 index 0000000..ee2a0f8 --- /dev/null +++ b/src/pipedream/types/timer_interface.py @@ -0,0 +1,40 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class TimerInterface(UniversalBaseModel): + """ + A timer interface instance + """ + + id: str = pydantic.Field() + """ + The unique ID of the timer interface + """ + + interval_seconds: typing.Optional[float] = None + cron: typing.Optional[str] = None + timezone: str + schedule_changed_at: int + created_at: int = pydantic.Field() + """ + The timestamp when the timer interface was created (epoch milliseconds) + """ + + updated_at: typing.Optional[int] = pydantic.Field(default=None) + """ + The timestamp when the timer interface was last updated (epoch milliseconds) + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/pipedream/types/tool_annotations.py b/src/pipedream/types/tool_annotations.py new file mode 100644 index 0000000..a66f513 --- /dev/null +++ b/src/pipedream/types/tool_annotations.py @@ -0,0 +1,56 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata + + +class ToolAnnotations(UniversalBaseModel): + """ + Optional properties describing component behavior + """ + + destructive_hint: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="destructiveHint")] = ( + pydantic.Field(default=None) + ) + """ + If true, the component may perform destructive updates to its environment. If false, the component performs only additive updates. + """ + + idempotent_hint: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="idempotentHint")] = ( + pydantic.Field(default=None) + ) + """ + If true, calling the component repeatedly with the same arguments will have no additional effect on the its environment. + """ + + open_world_hint: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="openWorldHint")] = ( + pydantic.Field(default=None) + ) + """ + If true, this component may interact with an “open world” of external entities. If false, the component's domain of interaction is closed. For example, the world of a web search component is open, whereas that of a memory component is not. + """ + + read_only_hint: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="readOnlyHint")] = ( + pydantic.Field(default=None) + ) + """ + If true, the component does not modify its environment. + """ + + title: typing.Optional[str] = pydantic.Field(default=None) + """ + A human-readable title for the component. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow