diff --git a/pyproject.toml b/pyproject.toml index f751d0e..70566cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ dynamic = ["version"] [tool.poetry] name = "pipedream" -version = "1.1.11" +version = "1.1.12" description = "" readme = "README.md" authors = [] diff --git a/src/pipedream/accounts/client.py b/src/pipedream/accounts/client.py index 79d552f..1e17b07 100644 --- a/src/pipedream/accounts/client.py +++ b/src/pipedream/accounts/client.py @@ -118,6 +118,7 @@ def create( external_user_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, name: typing.Optional[str] = OMIT, + account_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> Account: """ @@ -142,6 +143,9 @@ def create( name : typing.Optional[str] Optional name for the account + account_id : typing.Optional[str] + An existing account ID to reconnect. When provided, the account's credentials are updated instead of creating a new account. Must belong to the same external user and project environment as the connect token, and match the app identified by app_slug. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -175,6 +179,7 @@ def create( external_user_id=external_user_id, oauth_app_id=oauth_app_id, name=name, + account_id=account_id, request_options=request_options, ) return _response.data @@ -403,6 +408,7 @@ async def create( external_user_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, name: typing.Optional[str] = OMIT, + account_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> Account: """ @@ -427,6 +433,9 @@ async def create( name : typing.Optional[str] Optional name for the account + account_id : typing.Optional[str] + An existing account ID to reconnect. When provided, the account's credentials are updated instead of creating a new account. Must belong to the same external user and project environment as the connect token, and match the app identified by app_slug. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -468,6 +477,7 @@ async def main() -> None: external_user_id=external_user_id, oauth_app_id=oauth_app_id, name=name, + account_id=account_id, request_options=request_options, ) return _response.data diff --git a/src/pipedream/accounts/raw_client.py b/src/pipedream/accounts/raw_client.py index 9539d78..a0059b1 100644 --- a/src/pipedream/accounts/raw_client.py +++ b/src/pipedream/accounts/raw_client.py @@ -132,6 +132,7 @@ def create( external_user_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, name: typing.Optional[str] = OMIT, + account_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[Account]: """ @@ -156,6 +157,9 @@ def create( name : typing.Optional[str] Optional name for the account + account_id : typing.Optional[str] + An existing account ID to reconnect. When provided, the account's credentials are updated instead of creating a new account. Must belong to the same external user and project environment as the connect token, and match the app identified by app_slug. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -176,6 +180,7 @@ def create( "cfmap_json": cfmap_json, "connect_token": connect_token, "name": name, + "account_id": account_id, }, headers={ "content-type": "application/json", @@ -466,6 +471,7 @@ async def create( external_user_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, name: typing.Optional[str] = OMIT, + account_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[Account]: """ @@ -490,6 +496,9 @@ async def create( name : typing.Optional[str] Optional name for the account + account_id : typing.Optional[str] + An existing account ID to reconnect. When provided, the account's credentials are updated instead of creating a new account. Must belong to the same external user and project environment as the connect token, and match the app identified by app_slug. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -510,6 +519,7 @@ async def create( "cfmap_json": cfmap_json, "connect_token": connect_token, "name": name, + "account_id": account_id, }, headers={ "content-type": "application/json", diff --git a/src/pipedream/core/client_wrapper.py b/src/pipedream/core/client_wrapper.py index 0bce8a3..43850fd 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.1.11", + "User-Agent": "pipedream/1.1.12", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "pipedream", - "X-Fern-SDK-Version": "1.1.11", + "X-Fern-SDK-Version": "1.1.12", **(self.get_custom_headers() or {}), } if self._project_environment is not None: diff --git a/src/pipedream/tokens/client.py b/src/pipedream/tokens/client.py index 584efaa..54cc816 100644 --- a/src/pipedream/tokens/client.py +++ b/src/pipedream/tokens/client.py @@ -110,6 +110,7 @@ def validate( ctok: ConnectToken, *, app_id: str, + account_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ValidateTokenResponse: @@ -123,6 +124,9 @@ def validate( app_id : str The app ID to validate against + account_id : typing.Optional[str] + An existing account ID to reconnect. Must belong to the app identified by app_id. + oauth_app_id : typing.Optional[str] The OAuth app ID to validate against (if the token is for an OAuth app) @@ -147,11 +151,12 @@ def validate( client.tokens.validate( ctok="ctok", app_id="app_id", + account_id="account_id", oauth_app_id="oauth_app_id", ) """ _response = self._raw_client.validate( - ctok, app_id=app_id, oauth_app_id=oauth_app_id, request_options=request_options + ctok, app_id=app_id, account_id=account_id, oauth_app_id=oauth_app_id, request_options=request_options ) return _response.data @@ -261,6 +266,7 @@ async def validate( ctok: ConnectToken, *, app_id: str, + account_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ValidateTokenResponse: @@ -274,6 +280,9 @@ async def validate( app_id : str The app ID to validate against + account_id : typing.Optional[str] + An existing account ID to reconnect. Must belong to the app identified by app_id. + oauth_app_id : typing.Optional[str] The OAuth app ID to validate against (if the token is for an OAuth app) @@ -303,6 +312,7 @@ async def main() -> None: await client.tokens.validate( ctok="ctok", app_id="app_id", + account_id="account_id", oauth_app_id="oauth_app_id", ) @@ -310,6 +320,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.validate( - ctok, app_id=app_id, oauth_app_id=oauth_app_id, request_options=request_options + ctok, app_id=app_id, account_id=account_id, oauth_app_id=oauth_app_id, request_options=request_options ) return _response.data diff --git a/src/pipedream/tokens/raw_client.py b/src/pipedream/tokens/raw_client.py index 5592355..b75beaa 100644 --- a/src/pipedream/tokens/raw_client.py +++ b/src/pipedream/tokens/raw_client.py @@ -122,6 +122,7 @@ def validate( ctok: ConnectToken, *, app_id: str, + account_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ValidateTokenResponse]: @@ -135,6 +136,9 @@ def validate( app_id : str The app ID to validate against + account_id : typing.Optional[str] + An existing account ID to reconnect. Must belong to the app identified by app_id. + oauth_app_id : typing.Optional[str] The OAuth app ID to validate against (if the token is for an OAuth app) @@ -151,6 +155,7 @@ def validate( method="GET", params={ "app_id": app_id, + "account_id": account_id, "oauth_app_id": oauth_app_id, }, request_options=request_options, @@ -286,6 +291,7 @@ async def validate( ctok: ConnectToken, *, app_id: str, + account_id: typing.Optional[str] = None, oauth_app_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ValidateTokenResponse]: @@ -299,6 +305,9 @@ async def validate( app_id : str The app ID to validate against + account_id : typing.Optional[str] + An existing account ID to reconnect. Must belong to the app identified by app_id. + oauth_app_id : typing.Optional[str] The OAuth app ID to validate against (if the token is for an OAuth app) @@ -315,6 +324,7 @@ async def validate( method="GET", params={ "app_id": app_id, + "account_id": account_id, "oauth_app_id": oauth_app_id, }, request_options=request_options,