diff --git a/pyproject.toml b/pyproject.toml index 1c46323..c93c57d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "pipedream" [tool.poetry] name = "pipedream" -version = "1.0.10" +version = "1.0.11" description = "" readme = "README.md" authors = [] diff --git a/src/pipedream/actions/client.py b/src/pipedream/actions/client.py index 17efbe0..cebb494 100644 --- a/src/pipedream/actions/client.py +++ b/src/pipedream/actions/client.py @@ -97,7 +97,13 @@ def list( after=after, before=before, limit=limit, q=q, app=app, request_options=request_options ) - def retrieve(self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Component: + def retrieve( + self, + component_id: str, + *, + version: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> Component: """ Get detailed configuration for a specific action by its key @@ -106,6 +112,9 @@ def retrieve(self, component_id: str, *, request_options: typing.Optional[Reques component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') + version : typing.Optional[str] + Optional semantic version of the component to retrieve (for example '1.0.0') + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -126,9 +135,10 @@ def retrieve(self, component_id: str, *, request_options: typing.Optional[Reques ) client.actions.retrieve( component_id="component_id", + version="1.2.3", ) """ - _response = self._raw_client.retrieve(component_id, request_options=request_options) + _response = self._raw_client.retrieve(component_id, version=version, request_options=request_options) return _response.data def configure_prop( @@ -137,6 +147,7 @@ def configure_prop( id: str, external_user_id: str, prop_name: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -159,6 +170,9 @@ def configure_prop( prop_name : str The name of the prop to configure + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -204,6 +218,7 @@ def configure_prop( id=id, external_user_id=external_user_id, prop_name=prop_name, + version=version, blocking=blocking, configured_props=configured_props, dynamic_props_id=dynamic_props_id, @@ -219,6 +234,7 @@ def reload_props( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -235,6 +251,9 @@ def reload_props( external_user_id : str The external user ID + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -269,6 +288,7 @@ def reload_props( _response = self._raw_client.reload_props( id=id, external_user_id=external_user_id, + version=version, blocking=blocking, configured_props=configured_props, dynamic_props_id=dynamic_props_id, @@ -281,6 +301,7 @@ def run( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, stash_id: typing.Optional[RunActionOptsStashId] = OMIT, @@ -297,6 +318,9 @@ def run( external_user_id : str The external user ID + version : typing.Optional[str] + Optional action component version (in SemVer format, for example '1.0.0'), defaults to latest + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] @@ -330,6 +354,7 @@ def run( _response = self._raw_client.run( id=id, external_user_id=external_user_id, + version=version, configured_props=configured_props, dynamic_props_id=dynamic_props_id, stash_id=stash_id, @@ -428,7 +453,11 @@ async def main() -> None: ) async def retrieve( - self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, + component_id: str, + *, + version: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> Component: """ Get detailed configuration for a specific action by its key @@ -438,6 +467,9 @@ async def retrieve( component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') + version : typing.Optional[str] + Optional semantic version of the component to retrieve (for example '1.0.0') + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -463,12 +495,13 @@ async def retrieve( async def main() -> None: await client.actions.retrieve( component_id="component_id", + version="1.2.3", ) asyncio.run(main()) """ - _response = await self._raw_client.retrieve(component_id, request_options=request_options) + _response = await self._raw_client.retrieve(component_id, version=version, request_options=request_options) return _response.data async def configure_prop( @@ -477,6 +510,7 @@ async def configure_prop( id: str, external_user_id: str, prop_name: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -499,6 +533,9 @@ async def configure_prop( prop_name : str The name of the prop to configure + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -552,6 +589,7 @@ async def main() -> None: id=id, external_user_id=external_user_id, prop_name=prop_name, + version=version, blocking=blocking, configured_props=configured_props, dynamic_props_id=dynamic_props_id, @@ -567,6 +605,7 @@ async def reload_props( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -583,6 +622,9 @@ async def reload_props( external_user_id : str The external user ID + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -625,6 +667,7 @@ async def main() -> None: _response = await self._raw_client.reload_props( id=id, external_user_id=external_user_id, + version=version, blocking=blocking, configured_props=configured_props, dynamic_props_id=dynamic_props_id, @@ -637,6 +680,7 @@ async def run( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, stash_id: typing.Optional[RunActionOptsStashId] = OMIT, @@ -653,6 +697,9 @@ async def run( external_user_id : str The external user ID + version : typing.Optional[str] + Optional action component version (in SemVer format, for example '1.0.0'), defaults to latest + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] @@ -694,6 +741,7 @@ async def main() -> None: _response = await self._raw_client.run( id=id, external_user_id=external_user_id, + version=version, configured_props=configured_props, dynamic_props_id=dynamic_props_id, stash_id=stash_id, diff --git a/src/pipedream/actions/raw_client.py b/src/pipedream/actions/raw_client.py index 2c7dc4b..1637a43 100644 --- a/src/pipedream/actions/raw_client.py +++ b/src/pipedream/actions/raw_client.py @@ -122,7 +122,11 @@ def list( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def retrieve( - self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, + component_id: str, + *, + version: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[Component]: """ Get detailed configuration for a specific action by its key @@ -132,6 +136,9 @@ def retrieve( component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') + version : typing.Optional[str] + Optional semantic version of the component to retrieve (for example '1.0.0') + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -143,6 +150,9 @@ def retrieve( _response = self._client_wrapper.httpx_client.request( f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/actions/{jsonable_encoder(component_id)}", method="GET", + params={ + "version": version, + }, request_options=request_options, ) try: @@ -178,6 +188,7 @@ def configure_prop( id: str, external_user_id: str, prop_name: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -200,6 +211,9 @@ def configure_prop( prop_name : str The name of the prop to configure + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -230,6 +244,7 @@ def configure_prop( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "prop_name": prop_name, "blocking": blocking, @@ -278,6 +293,7 @@ def reload_props( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -294,6 +310,9 @@ def reload_props( external_user_id : str The external user ID + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -315,6 +334,7 @@ def reload_props( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "blocking": blocking, "configured_props": convert_and_respect_annotation_metadata( @@ -359,6 +379,7 @@ def run( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, stash_id: typing.Optional[RunActionOptsStashId] = OMIT, @@ -375,6 +396,9 @@ def run( external_user_id : str The external user ID + version : typing.Optional[str] + Optional action component version (in SemVer format, for example '1.0.0'), defaults to latest + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] @@ -395,6 +419,7 @@ def run( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "configured_props": convert_and_respect_annotation_metadata( object_=configured_props, annotation=ConfiguredProps, direction="write" @@ -537,7 +562,11 @@ async def _get_next(): raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def retrieve( - self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, + component_id: str, + *, + version: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[Component]: """ Get detailed configuration for a specific action by its key @@ -547,6 +576,9 @@ async def retrieve( component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') + version : typing.Optional[str] + Optional semantic version of the component to retrieve (for example '1.0.0') + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -558,6 +590,9 @@ async def retrieve( _response = await self._client_wrapper.httpx_client.request( f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/actions/{jsonable_encoder(component_id)}", method="GET", + params={ + "version": version, + }, request_options=request_options, ) try: @@ -593,6 +628,7 @@ async def configure_prop( id: str, external_user_id: str, prop_name: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -615,6 +651,9 @@ async def configure_prop( prop_name : str The name of the prop to configure + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -645,6 +684,7 @@ async def configure_prop( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "prop_name": prop_name, "blocking": blocking, @@ -693,6 +733,7 @@ async def reload_props( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -709,6 +750,9 @@ async def reload_props( external_user_id : str The external user ID + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -730,6 +774,7 @@ async def reload_props( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "blocking": blocking, "configured_props": convert_and_respect_annotation_metadata( @@ -774,6 +819,7 @@ async def run( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, stash_id: typing.Optional[RunActionOptsStashId] = OMIT, @@ -790,6 +836,9 @@ async def run( external_user_id : str The external user ID + version : typing.Optional[str] + Optional action component version (in SemVer format, for example '1.0.0'), defaults to latest + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] @@ -810,6 +859,7 @@ async def run( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "configured_props": convert_and_respect_annotation_metadata( object_=configured_props, annotation=ConfiguredProps, direction="write" diff --git a/src/pipedream/components/client.py b/src/pipedream/components/client.py index 1fe5af7..a68c358 100644 --- a/src/pipedream/components/client.py +++ b/src/pipedream/components/client.py @@ -107,7 +107,13 @@ def list( request_options=request_options, ) - def retrieve(self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Component: + def retrieve( + self, + component_id: str, + *, + version: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> Component: """ Get detailed configuration for a specific component by its key @@ -116,6 +122,9 @@ def retrieve(self, component_id: str, *, request_options: typing.Optional[Reques component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') + version : typing.Optional[str] + Optional semantic version of the component to retrieve (for example '1.0.0') + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -136,9 +145,10 @@ def retrieve(self, component_id: str, *, request_options: typing.Optional[Reques ) client.components.retrieve( component_id="component_id", + version="1.2.3", ) """ - _response = self._raw_client.retrieve(component_id, request_options=request_options) + _response = self._raw_client.retrieve(component_id, version=version, request_options=request_options) return _response.data def configure_prop( @@ -147,6 +157,7 @@ def configure_prop( id: str, external_user_id: str, prop_name: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -169,6 +180,9 @@ def configure_prop( prop_name : str The name of the prop to configure + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -214,6 +228,7 @@ def configure_prop( id=id, external_user_id=external_user_id, prop_name=prop_name, + version=version, blocking=blocking, configured_props=configured_props, dynamic_props_id=dynamic_props_id, @@ -229,6 +244,7 @@ def reload_props( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -245,6 +261,9 @@ def reload_props( external_user_id : str The external user ID + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -279,6 +298,7 @@ def reload_props( _response = self._raw_client.reload_props( id=id, external_user_id=external_user_id, + version=version, blocking=blocking, configured_props=configured_props, dynamic_props_id=dynamic_props_id, @@ -388,7 +408,11 @@ async def main() -> None: ) async def retrieve( - self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, + component_id: str, + *, + version: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> Component: """ Get detailed configuration for a specific component by its key @@ -398,6 +422,9 @@ async def retrieve( component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') + version : typing.Optional[str] + Optional semantic version of the component to retrieve (for example '1.0.0') + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -423,12 +450,13 @@ async def retrieve( async def main() -> None: await client.components.retrieve( component_id="component_id", + version="1.2.3", ) asyncio.run(main()) """ - _response = await self._raw_client.retrieve(component_id, request_options=request_options) + _response = await self._raw_client.retrieve(component_id, version=version, request_options=request_options) return _response.data async def configure_prop( @@ -437,6 +465,7 @@ async def configure_prop( id: str, external_user_id: str, prop_name: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -459,6 +488,9 @@ async def configure_prop( prop_name : str The name of the prop to configure + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -512,6 +544,7 @@ async def main() -> None: id=id, external_user_id=external_user_id, prop_name=prop_name, + version=version, blocking=blocking, configured_props=configured_props, dynamic_props_id=dynamic_props_id, @@ -527,6 +560,7 @@ async def reload_props( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -543,6 +577,9 @@ async def reload_props( external_user_id : str The external user ID + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -585,6 +622,7 @@ async def main() -> None: _response = await self._raw_client.reload_props( id=id, external_user_id=external_user_id, + version=version, blocking=blocking, configured_props=configured_props, dynamic_props_id=dynamic_props_id, diff --git a/src/pipedream/components/raw_client.py b/src/pipedream/components/raw_client.py index 10f69c9..3453921 100644 --- a/src/pipedream/components/raw_client.py +++ b/src/pipedream/components/raw_client.py @@ -127,7 +127,11 @@ def list( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def retrieve( - self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, + component_id: str, + *, + version: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[Component]: """ Get detailed configuration for a specific component by its key @@ -137,6 +141,9 @@ def retrieve( component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') + version : typing.Optional[str] + Optional semantic version of the component to retrieve (for example '1.0.0') + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -148,6 +155,9 @@ def retrieve( _response = self._client_wrapper.httpx_client.request( f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/components/{jsonable_encoder(component_id)}", method="GET", + params={ + "version": version, + }, request_options=request_options, ) try: @@ -183,6 +193,7 @@ def configure_prop( id: str, external_user_id: str, prop_name: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -205,6 +216,9 @@ def configure_prop( prop_name : str The name of the prop to configure + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -235,6 +249,7 @@ def configure_prop( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "prop_name": prop_name, "blocking": blocking, @@ -283,6 +298,7 @@ def reload_props( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -299,6 +315,9 @@ def reload_props( external_user_id : str The external user ID + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -320,6 +339,7 @@ def reload_props( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "blocking": blocking, "configured_props": convert_and_respect_annotation_metadata( @@ -466,7 +486,11 @@ async def _get_next(): raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def retrieve( - self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, + component_id: str, + *, + version: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[Component]: """ Get detailed configuration for a specific component by its key @@ -476,6 +500,9 @@ async def retrieve( component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') + version : typing.Optional[str] + Optional semantic version of the component to retrieve (for example '1.0.0') + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -487,6 +514,9 @@ async def retrieve( _response = await self._client_wrapper.httpx_client.request( f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/components/{jsonable_encoder(component_id)}", method="GET", + params={ + "version": version, + }, request_options=request_options, ) try: @@ -522,6 +552,7 @@ async def configure_prop( id: str, external_user_id: str, prop_name: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -544,6 +575,9 @@ async def configure_prop( prop_name : str The name of the prop to configure + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -574,6 +608,7 @@ async def configure_prop( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "prop_name": prop_name, "blocking": blocking, @@ -622,6 +657,7 @@ async def reload_props( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -638,6 +674,9 @@ async def reload_props( external_user_id : str The external user ID + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -659,6 +698,7 @@ async def reload_props( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "blocking": blocking, "configured_props": convert_and_respect_annotation_metadata( diff --git a/src/pipedream/core/client_wrapper.py b/src/pipedream/core/client_wrapper.py index f05bb5d..d1cbb05 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.10", + "User-Agent": "pipedream/1.0.11", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "pipedream", - "X-Fern-SDK-Version": "1.0.10", + "X-Fern-SDK-Version": "1.0.11", **(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 2a9e05e..ea92f4e 100644 --- a/src/pipedream/deployed_triggers/client.py +++ b/src/pipedream/deployed_triggers/client.py @@ -6,9 +6,9 @@ from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions 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.emitter import Emitter +from ..types.emitter_type import EmitterType from ..types.get_trigger_webhooks_response import GetTriggerWebhooksResponse from ..types.get_trigger_workflows_response import GetTriggerWorkflowsResponse from .raw_client import AsyncRawDeployedTriggersClient, RawDeployedTriggersClient @@ -39,8 +39,9 @@ def list( after: typing.Optional[str] = None, before: typing.Optional[str] = None, limit: typing.Optional[int] = None, + emitter_type: typing.Optional[EmitterType] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[DeployedComponent]: + ) -> SyncPager[Emitter]: """ Retrieve all deployed triggers for a specific external user @@ -58,12 +59,15 @@ def list( limit : typing.Optional[int] The maximum number of results to return + emitter_type : typing.Optional[EmitterType] + Filter deployed triggers by emitter type (defaults to 'source' if not provided) + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SyncPager[DeployedComponent] + SyncPager[Emitter] deployed triggers listed Examples @@ -81,6 +85,7 @@ def list( before="before", limit=1, external_user_id="external_user_id", + emitter_type="email", ) for item in response: yield item @@ -89,12 +94,17 @@ def list( yield page """ return self._raw_client.list( - external_user_id=external_user_id, after=after, before=before, limit=limit, request_options=request_options + external_user_id=external_user_id, + after=after, + before=before, + limit=limit, + emitter_type=emitter_type, + request_options=request_options, ) def retrieve( self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None - ) -> GetTriggerResponseData: + ) -> Emitter: """ Get details of a specific deployed trigger by its ID @@ -110,7 +120,7 @@ def retrieve( Returns ------- - GetTriggerResponseData + Emitter deployed trigger retrieved Examples @@ -142,7 +152,7 @@ def update( configured_props: typing.Optional[ConfiguredProps] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> GetTriggerResponseData: + ) -> Emitter: """ Modify the configuration of a deployed trigger, including active status @@ -166,7 +176,7 @@ def update( Returns ------- - GetTriggerResponseData + Emitter deployed trigger updated Examples @@ -501,8 +511,9 @@ async def list( after: typing.Optional[str] = None, before: typing.Optional[str] = None, limit: typing.Optional[int] = None, + emitter_type: typing.Optional[EmitterType] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[DeployedComponent]: + ) -> AsyncPager[Emitter]: """ Retrieve all deployed triggers for a specific external user @@ -520,12 +531,15 @@ async def list( limit : typing.Optional[int] The maximum number of results to return + emitter_type : typing.Optional[EmitterType] + Filter deployed triggers by emitter type (defaults to 'source' if not provided) + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncPager[DeployedComponent] + AsyncPager[Emitter] deployed triggers listed Examples @@ -548,6 +562,7 @@ async def main() -> None: before="before", limit=1, external_user_id="external_user_id", + emitter_type="email", ) async for item in response: yield item @@ -560,12 +575,17 @@ async def main() -> None: asyncio.run(main()) """ return await self._raw_client.list( - external_user_id=external_user_id, after=after, before=before, limit=limit, request_options=request_options + external_user_id=external_user_id, + after=after, + before=before, + limit=limit, + emitter_type=emitter_type, + request_options=request_options, ) async def retrieve( self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None - ) -> GetTriggerResponseData: + ) -> Emitter: """ Get details of a specific deployed trigger by its ID @@ -581,7 +601,7 @@ async def retrieve( Returns ------- - GetTriggerResponseData + Emitter deployed trigger retrieved Examples @@ -621,7 +641,7 @@ async def update( configured_props: typing.Optional[ConfiguredProps] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> GetTriggerResponseData: + ) -> Emitter: """ Modify the configuration of a deployed trigger, including active status @@ -645,7 +665,7 @@ async def update( Returns ------- - GetTriggerResponseData + Emitter deployed trigger updated Examples diff --git a/src/pipedream/deployed_triggers/raw_client.py b/src/pipedream/deployed_triggers/raw_client.py index 36e78ac..4b2e576 100644 --- a/src/pipedream/deployed_triggers/raw_client.py +++ b/src/pipedream/deployed_triggers/raw_client.py @@ -13,11 +13,11 @@ from ..core.serialization import convert_and_respect_annotation_metadata from ..errors.too_many_requests_error import TooManyRequestsError from ..types.configured_props import ConfiguredProps -from ..types.deployed_component import DeployedComponent from ..types.emitted_event import EmittedEvent +from ..types.emitter import Emitter +from ..types.emitter_type import EmitterType 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 @@ -37,8 +37,9 @@ def list( after: typing.Optional[str] = None, before: typing.Optional[str] = None, limit: typing.Optional[int] = None, + emitter_type: typing.Optional[EmitterType] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[DeployedComponent]: + ) -> SyncPager[Emitter]: """ Retrieve all deployed triggers for a specific external user @@ -56,12 +57,15 @@ def list( limit : typing.Optional[int] The maximum number of results to return + emitter_type : typing.Optional[EmitterType] + Filter deployed triggers by emitter type (defaults to 'source' if not provided) + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SyncPager[DeployedComponent] + SyncPager[Emitter] deployed triggers listed """ _response = self._client_wrapper.httpx_client.request( @@ -72,6 +76,7 @@ def list( "before": before, "limit": limit, "external_user_id": external_user_id, + "emitter_type": emitter_type, }, request_options=request_options, ) @@ -95,6 +100,7 @@ def list( after=_parsed_next, before=before, limit=limit, + emitter_type=emitter_type, request_options=request_options, ) return SyncPager( @@ -118,7 +124,7 @@ def list( def retrieve( self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[GetTriggerResponseData]: + ) -> HttpResponse[Emitter]: """ Get details of a specific deployed trigger by its ID @@ -134,7 +140,7 @@ def retrieve( Returns ------- - HttpResponse[GetTriggerResponseData] + HttpResponse[Emitter] deployed trigger retrieved """ _response = self._client_wrapper.httpx_client.request( @@ -181,7 +187,7 @@ def update( configured_props: typing.Optional[ConfiguredProps] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[GetTriggerResponseData]: + ) -> HttpResponse[Emitter]: """ Modify the configuration of a deployed trigger, including active status @@ -205,7 +211,7 @@ def update( Returns ------- - HttpResponse[GetTriggerResponseData] + HttpResponse[Emitter] deployed trigger updated """ _response = self._client_wrapper.httpx_client.request( @@ -637,8 +643,9 @@ async def list( after: typing.Optional[str] = None, before: typing.Optional[str] = None, limit: typing.Optional[int] = None, + emitter_type: typing.Optional[EmitterType] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[DeployedComponent]: + ) -> AsyncPager[Emitter]: """ Retrieve all deployed triggers for a specific external user @@ -656,12 +663,15 @@ async def list( limit : typing.Optional[int] The maximum number of results to return + emitter_type : typing.Optional[EmitterType] + Filter deployed triggers by emitter type (defaults to 'source' if not provided) + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncPager[DeployedComponent] + AsyncPager[Emitter] deployed triggers listed """ _response = await self._client_wrapper.httpx_client.request( @@ -672,6 +682,7 @@ async def list( "before": before, "limit": limit, "external_user_id": external_user_id, + "emitter_type": emitter_type, }, request_options=request_options, ) @@ -697,6 +708,7 @@ async def _get_next(): after=_parsed_next, before=before, limit=limit, + emitter_type=emitter_type, request_options=request_options, ) @@ -721,7 +733,7 @@ async def _get_next(): async def retrieve( self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[GetTriggerResponseData]: + ) -> AsyncHttpResponse[Emitter]: """ Get details of a specific deployed trigger by its ID @@ -737,7 +749,7 @@ async def retrieve( Returns ------- - AsyncHttpResponse[GetTriggerResponseData] + AsyncHttpResponse[Emitter] deployed trigger retrieved """ _response = await self._client_wrapper.httpx_client.request( @@ -784,7 +796,7 @@ async def update( configured_props: typing.Optional[ConfiguredProps] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[GetTriggerResponseData]: + ) -> AsyncHttpResponse[Emitter]: """ Modify the configuration of a deployed trigger, including active status @@ -808,7 +820,7 @@ async def update( Returns ------- - AsyncHttpResponse[GetTriggerResponseData] + AsyncHttpResponse[Emitter] deployed trigger updated """ _response = await self._client_wrapper.httpx_client.request( diff --git a/src/pipedream/oauth_tokens/client.py b/src/pipedream/oauth_tokens/client.py index 18a5de5..3dca46c 100644 --- a/src/pipedream/oauth_tokens/client.py +++ b/src/pipedream/oauth_tokens/client.py @@ -27,7 +27,12 @@ def with_raw_response(self) -> RawOauthTokensClient: return self._raw_client def create( - self, *, client_id: str, client_secret: str, request_options: typing.Optional[RequestOptions] = None + self, + *, + client_id: str, + client_secret: str, + scope: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> CreateOAuthTokenResponse: """ Exchange OAuth credentials for an access token @@ -38,6 +43,9 @@ def create( client_secret : str + scope : typing.Optional[str] + Optional space-separated scopes for the access token. Defaults to '*'. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -62,7 +70,7 @@ def create( ) """ _response = self._raw_client.create( - client_id=client_id, client_secret=client_secret, request_options=request_options + client_id=client_id, client_secret=client_secret, scope=scope, request_options=request_options ) return _response.data @@ -83,7 +91,12 @@ def with_raw_response(self) -> AsyncRawOauthTokensClient: return self._raw_client async def create( - self, *, client_id: str, client_secret: str, request_options: typing.Optional[RequestOptions] = None + self, + *, + client_id: str, + client_secret: str, + scope: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> CreateOAuthTokenResponse: """ Exchange OAuth credentials for an access token @@ -94,6 +107,9 @@ async def create( client_secret : str + scope : typing.Optional[str] + Optional space-separated scopes for the access token. Defaults to '*'. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -126,6 +142,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.create( - client_id=client_id, client_secret=client_secret, request_options=request_options + client_id=client_id, client_secret=client_secret, scope=scope, request_options=request_options ) return _response.data diff --git a/src/pipedream/oauth_tokens/raw_client.py b/src/pipedream/oauth_tokens/raw_client.py index 8fc2cb4..30fa1b7 100644 --- a/src/pipedream/oauth_tokens/raw_client.py +++ b/src/pipedream/oauth_tokens/raw_client.py @@ -19,7 +19,12 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( - self, *, client_id: str, client_secret: str, request_options: typing.Optional[RequestOptions] = None + self, + *, + client_id: str, + client_secret: str, + scope: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateOAuthTokenResponse]: """ Exchange OAuth credentials for an access token @@ -30,6 +35,9 @@ def create( client_secret : str + scope : typing.Optional[str] + Optional space-separated scopes for the access token. Defaults to '*'. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -44,6 +52,7 @@ def create( json={ "client_id": client_id, "client_secret": client_secret, + "scope": scope, "grant_type": "client_credentials", }, headers={ @@ -73,7 +82,12 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( - self, *, client_id: str, client_secret: str, request_options: typing.Optional[RequestOptions] = None + self, + *, + client_id: str, + client_secret: str, + scope: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateOAuthTokenResponse]: """ Exchange OAuth credentials for an access token @@ -84,6 +98,9 @@ async def create( client_secret : str + scope : typing.Optional[str] + Optional space-separated scopes for the access token. Defaults to '*'. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -98,6 +115,7 @@ async def create( json={ "client_id": client_id, "client_secret": client_secret, + "scope": scope, "grant_type": "client_credentials", }, headers={ diff --git a/src/pipedream/triggers/client.py b/src/pipedream/triggers/client.py index faf4a2a..85a6646 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.deploy_trigger_response_data import DeployTriggerResponseData +from ..types.emitter import Emitter from ..types.reload_props_response import ReloadPropsResponse from .raw_client import AsyncRawTriggersClient, RawTriggersClient @@ -96,7 +96,13 @@ def list( after=after, before=before, limit=limit, q=q, app=app, request_options=request_options ) - def retrieve(self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Component: + def retrieve( + self, + component_id: str, + *, + version: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> Component: """ Get detailed configuration for a specific trigger by its key @@ -105,6 +111,9 @@ def retrieve(self, component_id: str, *, request_options: typing.Optional[Reques component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') + version : typing.Optional[str] + Optional semantic version of the component to retrieve (for example '1.0.0') + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -125,9 +134,10 @@ def retrieve(self, component_id: str, *, request_options: typing.Optional[Reques ) client.triggers.retrieve( component_id="component_id", + version="1.2.3", ) """ - _response = self._raw_client.retrieve(component_id, request_options=request_options) + _response = self._raw_client.retrieve(component_id, version=version, request_options=request_options) return _response.data def configure_prop( @@ -136,6 +146,7 @@ def configure_prop( id: str, external_user_id: str, prop_name: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -158,6 +169,9 @@ def configure_prop( prop_name : str The name of the prop to configure + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -203,6 +217,7 @@ def configure_prop( id=id, external_user_id=external_user_id, prop_name=prop_name, + version=version, blocking=blocking, configured_props=configured_props, dynamic_props_id=dynamic_props_id, @@ -218,6 +233,7 @@ def reload_props( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -234,6 +250,9 @@ def reload_props( external_user_id : str The external user ID + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -268,6 +287,7 @@ def reload_props( _response = self._raw_client.reload_props( id=id, external_user_id=external_user_id, + version=version, blocking=blocking, configured_props=configured_props, dynamic_props_id=dynamic_props_id, @@ -280,11 +300,13 @@ def deploy( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, + workflow_id: typing.Optional[str] = OMIT, webhook_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> DeployTriggerResponseData: + ) -> Emitter: """ Deploy a trigger to listen for and emit events @@ -296,11 +318,17 @@ def deploy( external_user_id : str The external user ID + version : typing.Optional[str] + Optional trigger component version (in SemVer format, for example '1.0.0'), defaults to latest + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props + workflow_id : typing.Optional[str] + Optional ID of a workflow to receive trigger events + webhook_url : typing.Optional[str] Optional webhook URL to receive trigger events @@ -309,7 +337,7 @@ def deploy( Returns ------- - DeployTriggerResponseData + Emitter trigger deployed Examples @@ -330,8 +358,10 @@ def deploy( _response = self._raw_client.deploy( id=id, external_user_id=external_user_id, + version=version, configured_props=configured_props, dynamic_props_id=dynamic_props_id, + workflow_id=workflow_id, webhook_url=webhook_url, request_options=request_options, ) @@ -428,7 +458,11 @@ async def main() -> None: ) async def retrieve( - self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, + component_id: str, + *, + version: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> Component: """ Get detailed configuration for a specific trigger by its key @@ -438,6 +472,9 @@ async def retrieve( component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') + version : typing.Optional[str] + Optional semantic version of the component to retrieve (for example '1.0.0') + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -463,12 +500,13 @@ async def retrieve( async def main() -> None: await client.triggers.retrieve( component_id="component_id", + version="1.2.3", ) asyncio.run(main()) """ - _response = await self._raw_client.retrieve(component_id, request_options=request_options) + _response = await self._raw_client.retrieve(component_id, version=version, request_options=request_options) return _response.data async def configure_prop( @@ -477,6 +515,7 @@ async def configure_prop( id: str, external_user_id: str, prop_name: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -499,6 +538,9 @@ async def configure_prop( prop_name : str The name of the prop to configure + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -552,6 +594,7 @@ async def main() -> None: id=id, external_user_id=external_user_id, prop_name=prop_name, + version=version, blocking=blocking, configured_props=configured_props, dynamic_props_id=dynamic_props_id, @@ -567,6 +610,7 @@ async def reload_props( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -583,6 +627,9 @@ async def reload_props( external_user_id : str The external user ID + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -625,6 +672,7 @@ async def main() -> None: _response = await self._raw_client.reload_props( id=id, external_user_id=external_user_id, + version=version, blocking=blocking, configured_props=configured_props, dynamic_props_id=dynamic_props_id, @@ -637,11 +685,13 @@ async def deploy( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, + workflow_id: typing.Optional[str] = OMIT, webhook_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> DeployTriggerResponseData: + ) -> Emitter: """ Deploy a trigger to listen for and emit events @@ -653,11 +703,17 @@ async def deploy( external_user_id : str The external user ID + version : typing.Optional[str] + Optional trigger component version (in SemVer format, for example '1.0.0'), defaults to latest + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props + workflow_id : typing.Optional[str] + Optional ID of a workflow to receive trigger events + webhook_url : typing.Optional[str] Optional webhook URL to receive trigger events @@ -666,7 +722,7 @@ async def deploy( Returns ------- - DeployTriggerResponseData + Emitter trigger deployed Examples @@ -695,8 +751,10 @@ async def main() -> None: _response = await self._raw_client.deploy( id=id, external_user_id=external_user_id, + version=version, configured_props=configured_props, dynamic_props_id=dynamic_props_id, + workflow_id=workflow_id, webhook_url=webhook_url, request_options=request_options, ) diff --git a/src/pipedream/triggers/raw_client.py b/src/pipedream/triggers/raw_client.py index abeb4de..0d5da95 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.deploy_trigger_response_data import DeployTriggerResponseData +from ..types.emitter import Emitter from ..types.get_component_response import GetComponentResponse from ..types.get_components_response import GetComponentsResponse from ..types.reload_props_response import ReloadPropsResponse @@ -122,7 +122,11 @@ def list( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def retrieve( - self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, + component_id: str, + *, + version: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[Component]: """ Get detailed configuration for a specific trigger by its key @@ -132,6 +136,9 @@ def retrieve( component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') + version : typing.Optional[str] + Optional semantic version of the component to retrieve (for example '1.0.0') + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -143,6 +150,9 @@ def retrieve( _response = self._client_wrapper.httpx_client.request( f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/triggers/{jsonable_encoder(component_id)}", method="GET", + params={ + "version": version, + }, request_options=request_options, ) try: @@ -178,6 +188,7 @@ def configure_prop( id: str, external_user_id: str, prop_name: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -200,6 +211,9 @@ def configure_prop( prop_name : str The name of the prop to configure + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -230,6 +244,7 @@ def configure_prop( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "prop_name": prop_name, "blocking": blocking, @@ -278,6 +293,7 @@ def reload_props( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -294,6 +310,9 @@ def reload_props( external_user_id : str The external user ID + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -315,6 +334,7 @@ def reload_props( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "blocking": blocking, "configured_props": convert_and_respect_annotation_metadata( @@ -359,11 +379,13 @@ def deploy( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, + workflow_id: typing.Optional[str] = OMIT, webhook_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[DeployTriggerResponseData]: + ) -> HttpResponse[Emitter]: """ Deploy a trigger to listen for and emit events @@ -375,11 +397,17 @@ def deploy( external_user_id : str The external user ID + version : typing.Optional[str] + Optional trigger component version (in SemVer format, for example '1.0.0'), defaults to latest + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props + workflow_id : typing.Optional[str] + Optional ID of a workflow to receive trigger events + webhook_url : typing.Optional[str] Optional webhook URL to receive trigger events @@ -388,7 +416,7 @@ def deploy( Returns ------- - HttpResponse[DeployTriggerResponseData] + HttpResponse[Emitter] trigger deployed """ _response = self._client_wrapper.httpx_client.request( @@ -396,11 +424,13 @@ def deploy( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "configured_props": convert_and_respect_annotation_metadata( object_=configured_props, annotation=ConfiguredProps, direction="write" ), "dynamic_props_id": dynamic_props_id, + "workflow_id": workflow_id, "webhook_url": webhook_url, }, headers={ @@ -537,7 +567,11 @@ async def _get_next(): raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def retrieve( - self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, + component_id: str, + *, + version: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[Component]: """ Get detailed configuration for a specific trigger by its key @@ -547,6 +581,9 @@ async def retrieve( component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') + version : typing.Optional[str] + Optional semantic version of the component to retrieve (for example '1.0.0') + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -558,6 +595,9 @@ async def retrieve( _response = await self._client_wrapper.httpx_client.request( f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/triggers/{jsonable_encoder(component_id)}", method="GET", + params={ + "version": version, + }, request_options=request_options, ) try: @@ -593,6 +633,7 @@ async def configure_prop( id: str, external_user_id: str, prop_name: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -615,6 +656,9 @@ async def configure_prop( prop_name : str The name of the prop to configure + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -645,6 +689,7 @@ async def configure_prop( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "prop_name": prop_name, "blocking": blocking, @@ -693,6 +738,7 @@ async def reload_props( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, blocking: typing.Optional[bool] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, @@ -709,6 +755,9 @@ async def reload_props( external_user_id : str The external user ID + version : typing.Optional[str] + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + blocking : typing.Optional[bool] Whether this operation should block until completion @@ -730,6 +779,7 @@ async def reload_props( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "blocking": blocking, "configured_props": convert_and_respect_annotation_metadata( @@ -774,11 +824,13 @@ async def deploy( *, id: str, external_user_id: str, + version: typing.Optional[str] = OMIT, configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, + workflow_id: typing.Optional[str] = OMIT, webhook_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[DeployTriggerResponseData]: + ) -> AsyncHttpResponse[Emitter]: """ Deploy a trigger to listen for and emit events @@ -790,11 +842,17 @@ async def deploy( external_user_id : str The external user ID + version : typing.Optional[str] + Optional trigger component version (in SemVer format, for example '1.0.0'), defaults to latest + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props + workflow_id : typing.Optional[str] + Optional ID of a workflow to receive trigger events + webhook_url : typing.Optional[str] Optional webhook URL to receive trigger events @@ -803,7 +861,7 @@ async def deploy( Returns ------- - AsyncHttpResponse[DeployTriggerResponseData] + AsyncHttpResponse[Emitter] trigger deployed """ _response = await self._client_wrapper.httpx_client.request( @@ -811,11 +869,13 @@ async def deploy( method="POST", json={ "id": id, + "version": version, "external_user_id": external_user_id, "configured_props": convert_and_respect_annotation_metadata( object_=configured_props, annotation=ConfiguredProps, direction="write" ), "dynamic_props_id": dynamic_props_id, + "workflow_id": workflow_id, "webhook_url": webhook_url, }, headers={ diff --git a/src/pipedream/types/__init__.py b/src/pipedream/types/__init__.py index e88ab8c..1484a49 100644 --- a/src/pipedream/types/__init__.py +++ b/src/pipedream/types/__init__.py @@ -71,10 +71,11 @@ 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 + from .emitter import Emitter, Emitter_DeployedComponent, Emitter_HttpInterface, Emitter_TimerInterface + from .emitter_type import EmitterType from .error_response import ErrorResponse from .get_accounts_response import GetAccountsResponse from .get_app_category_response import GetAppCategoryResponse @@ -84,7 +85,6 @@ 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 @@ -180,10 +180,14 @@ "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", + "Emitter": ".emitter", + "EmitterType": ".emitter_type", + "Emitter_DeployedComponent": ".emitter", + "Emitter_HttpInterface": ".emitter", + "Emitter_TimerInterface": ".emitter", "ErrorResponse": ".error_response", "GetAccountsResponse": ".get_accounts_response", "GetAppCategoryResponse": ".get_app_category_response", @@ -193,7 +197,6 @@ "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", @@ -313,10 +316,14 @@ def __dir__(): "CreateTokenResponse", "DeleteTriggerOpts", "DeployTriggerResponse", - "DeployTriggerResponseData", "DeployedComponent", "DynamicProps", "EmittedEvent", + "Emitter", + "EmitterType", + "Emitter_DeployedComponent", + "Emitter_HttpInterface", + "Emitter_TimerInterface", "ErrorResponse", "GetAccountsResponse", "GetAppCategoryResponse", @@ -326,7 +333,6 @@ def __dir__(): "GetComponentsResponse", "GetTriggerEventsResponse", "GetTriggerResponse", - "GetTriggerResponseData", "GetTriggerWebhooksResponse", "GetTriggerWorkflowsResponse", "GetTriggersResponse", diff --git a/src/pipedream/types/backend_client_opts.py b/src/pipedream/types/backend_client_opts.py index 9ed37b8..8c0ee71 100644 --- a/src/pipedream/types/backend_client_opts.py +++ b/src/pipedream/types/backend_client_opts.py @@ -26,6 +26,11 @@ class BackendClientOpts(UniversalBaseModel): The API URL to use """ + scope: typing.Optional[str] = pydantic.Field(default=None) + """ + Optional space-separated scopes for the access token. Defaults to '*'. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/pipedream/types/configure_prop_opts.py b/src/pipedream/types/configure_prop_opts.py index 2566173..bee3f7c 100644 --- a/src/pipedream/types/configure_prop_opts.py +++ b/src/pipedream/types/configure_prop_opts.py @@ -17,6 +17,11 @@ class ConfigurePropOpts(UniversalBaseModel): The component ID """ + version: typing.Optional[str] = pydantic.Field(default=None) + """ + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + """ + external_user_id: str = pydantic.Field() """ The external user ID diff --git a/src/pipedream/types/deploy_trigger_response.py b/src/pipedream/types/deploy_trigger_response.py index 3ef2b0b..03fc556 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 .deploy_trigger_response_data import DeployTriggerResponseData +from .emitter import Emitter class DeployTriggerResponse(UniversalBaseModel): @@ -12,7 +12,7 @@ class DeployTriggerResponse(UniversalBaseModel): Response received after deploying a trigger """ - data: DeployTriggerResponseData + data: Emitter 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 deleted file mode 100644 index 3a175e2..0000000 --- a/src/pipedream/types/deploy_trigger_response_data.py +++ /dev/null @@ -1,9 +0,0 @@ -# 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/deployed_component.py b/src/pipedream/types/deployed_component.py index e8cb682..39ba6c2 100644 --- a/src/pipedream/types/deployed_component.py +++ b/src/pipedream/types/deployed_component.py @@ -28,6 +28,11 @@ class DeployedComponent(UniversalBaseModel): The ID of the component that was deployed """ + component_key: typing.Optional[str] = pydantic.Field(default=None) + """ + The component key (name) that was deployed + """ + configurable_props: typing.List[ConfigurableProp] = pydantic.Field() """ The configurable properties of the component diff --git a/src/pipedream/types/emitter.py b/src/pipedream/types/emitter.py new file mode 100644 index 0000000..cd4962f --- /dev/null +++ b/src/pipedream/types/emitter.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .configurable_prop import ConfigurableProp +from .configured_props import ConfiguredProps + + +class Emitter_DeployedComponent(UniversalBaseModel): + """ + A component/interface that emits events + """ + + type: typing.Literal["DeployedComponent"] = "DeployedComponent" + id: str + owner_id: str + component_id: str + component_key: typing.Optional[str] = None + configurable_props: typing.List[ConfigurableProp] + configured_props: ConfiguredProps + active: bool + created_at: int + updated_at: int + name: str + name_slug: str + callback_observations: typing.Optional[typing.Optional[typing.Any]] = None + + 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 + + +class Emitter_HttpInterface(UniversalBaseModel): + """ + A component/interface that emits events + """ + + type: typing.Literal["HttpInterface"] = "HttpInterface" + id: str + key: str + endpoint_url: str + custom_response: bool + created_at: int + updated_at: int + + 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 + + +class Emitter_TimerInterface(UniversalBaseModel): + """ + A component/interface that emits events + """ + + type: typing.Literal["TimerInterface"] = "TimerInterface" + id: str + interval_seconds: typing.Optional[float] = None + cron: typing.Optional[str] = None + timezone: str + schedule_changed_at: int + created_at: int + updated_at: int + + 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 + + +Emitter = typing.Union[Emitter_DeployedComponent, Emitter_HttpInterface, Emitter_TimerInterface] diff --git a/src/pipedream/types/emitter_type.py b/src/pipedream/types/emitter_type.py new file mode 100644 index 0000000..6d796ef --- /dev/null +++ b/src/pipedream/types/emitter_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +EmitterType = typing.Union[typing.Literal["email", "http", "source", "timer"], typing.Any] diff --git a/src/pipedream/types/get_trigger_response.py b/src/pipedream/types/get_trigger_response.py index 977f20e..2ff36f7 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 .get_trigger_response_data import GetTriggerResponseData +from .emitter import Emitter class GetTriggerResponse(UniversalBaseModel): @@ -12,7 +12,7 @@ class GetTriggerResponse(UniversalBaseModel): Response received when retrieving a deployed trigger """ - data: GetTriggerResponseData + data: Emitter 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 deleted file mode 100644 index 5817054..0000000 --- a/src/pipedream/types/get_trigger_response_data.py +++ /dev/null @@ -1,9 +0,0 @@ -# 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/get_triggers_response.py b/src/pipedream/types/get_triggers_response.py index 19d13ab..e0b7e30 100644 --- a/src/pipedream/types/get_triggers_response.py +++ b/src/pipedream/types/get_triggers_response.py @@ -4,7 +4,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .deployed_component import DeployedComponent +from .emitter import Emitter from .page_info import PageInfo @@ -13,7 +13,7 @@ class GetTriggersResponse(UniversalBaseModel): Response received when listing deployed triggers """ - data: typing.List[DeployedComponent] + data: typing.List[Emitter] page_info: PageInfo if IS_PYDANTIC_V2: diff --git a/src/pipedream/types/http_interface.py b/src/pipedream/types/http_interface.py index 7c32c5f..f485f53 100644 --- a/src/pipedream/types/http_interface.py +++ b/src/pipedream/types/http_interface.py @@ -24,7 +24,7 @@ class HttpInterface(UniversalBaseModel): The timestamp when the HTTP interface was created (epoch milliseconds) """ - updated_at: typing.Optional[int] = pydantic.Field(default=None) + updated_at: int = pydantic.Field() """ The timestamp when the HTTP interface was last updated (epoch milliseconds) """ diff --git a/src/pipedream/types/reload_props_opts.py b/src/pipedream/types/reload_props_opts.py index 124eb34..34399b8 100644 --- a/src/pipedream/types/reload_props_opts.py +++ b/src/pipedream/types/reload_props_opts.py @@ -17,6 +17,11 @@ class ReloadPropsOpts(UniversalBaseModel): The component ID """ + version: typing.Optional[str] = pydantic.Field(default=None) + """ + Optional component version (in SemVer format, for example '1.0.0'), defaults to latest + """ + external_user_id: str = pydantic.Field() """ The external user ID diff --git a/src/pipedream/types/timer_interface.py b/src/pipedream/types/timer_interface.py index ee2a0f8..bb103cc 100644 --- a/src/pipedream/types/timer_interface.py +++ b/src/pipedream/types/timer_interface.py @@ -25,7 +25,7 @@ class TimerInterface(UniversalBaseModel): The timestamp when the timer interface was created (epoch milliseconds) """ - updated_at: typing.Optional[int] = pydantic.Field(default=None) + updated_at: int = pydantic.Field() """ The timestamp when the timer interface was last updated (epoch milliseconds) """