diff --git a/README.md b/README.md index 9c5abb7..36a4706 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,12 @@ Instantiate and use the client with the following: from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.accounts.create( - project_id="project_id", app_slug="app_slug", cfmap_json="cfmap_json", connect_token="connect_token", @@ -45,6 +45,7 @@ import asyncio from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -53,7 +54,6 @@ client = AsyncPipedream( async def main() -> None: await client.accounts.create( - project_id="project_id", app_slug="app_slug", cfmap_json="cfmap_json", connect_token="connect_token", @@ -86,6 +86,7 @@ Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", diff --git a/reference.md b/reference.md index 26909eb..6713ecd 100644 --- a/reference.md +++ b/reference.md @@ -16,6 +16,7 @@ from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -64,6 +65,7 @@ client.app_categories.list() from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -123,6 +125,7 @@ client.app_categories.retrieve( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -232,6 +235,7 @@ for page in response.iter_pages(): from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -291,13 +295,12 @@ client.apps.retrieve( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) -response = client.accounts.list( - project_id="project_id", -) +response = client.accounts.list() for item in response: yield item # alternatively, you can paginate page-by-page @@ -318,14 +321,6 @@ for page in response.iter_pages():
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **app_id:** `typing.Optional[str]` — The app slug or ID to filter accounts by.
@@ -410,12 +405,12 @@ for page in response.iter_pages(): from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.accounts.create( - project_id="project_id", app_slug="app_slug", cfmap_json="cfmap_json", connect_token="connect_token", @@ -435,14 +430,6 @@ client.accounts.create(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **app_slug:** `str` — The app slug for the account
@@ -527,12 +514,12 @@ client.accounts.create( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.accounts.retrieve( - project_id="project_id", account_id="account_id", ) @@ -550,14 +537,6 @@ client.accounts.retrieve(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **account_id:** `str`
@@ -602,12 +581,12 @@ client.accounts.retrieve( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.accounts.delete( - project_id="project_id", account_id="account_id", ) @@ -625,14 +604,6 @@ client.accounts.delete(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **account_id:** `str`
@@ -669,12 +640,12 @@ client.accounts.delete( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.accounts.delete_by_app( - project_id="project_id", app_id="app_id", ) @@ -692,14 +663,6 @@ client.accounts.delete_by_app(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **app_id:** `str`
@@ -737,12 +700,12 @@ client.accounts.delete_by_app( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.users.delete_external_user( - project_id="project_id", external_user_id="external_user_id", ) @@ -760,14 +723,6 @@ client.users.delete_external_user(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **external_user_id:** `str`
@@ -805,13 +760,12 @@ client.users.delete_external_user( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) -response = client.components.list( - project_id="project_id", -) +response = client.components.list() for item in response: yield item # alternatively, you can paginate page-by-page @@ -832,14 +786,6 @@ for page in response.iter_pages():
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **after:** `typing.Optional[str]` — The cursor to start from for pagination
@@ -908,12 +854,12 @@ for page in response.iter_pages(): from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.components.retrieve( - project_id="project_id", component_id="component_id", ) @@ -931,14 +877,6 @@ client.components.retrieve(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **component_id:** `str` — The key that uniquely identifies the component (e.g., 'slack-send-message')
@@ -975,12 +913,12 @@ client.components.retrieve( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.components.configure_prop( - project_id="project_id", id="id", external_user_id="external_user_id", prop_name="prop_name", @@ -1000,14 +938,6 @@ client.components.configure_prop(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **id:** `str` — The component ID
@@ -1124,12 +1054,12 @@ client.components.configure_prop( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.components.reload_props( - project_id="project_id", id="id", external_user_id="external_user_id", ) @@ -1148,14 +1078,6 @@ client.components.reload_props(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **id:** `str` — The component ID
@@ -1241,13 +1163,12 @@ client.components.reload_props( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) -response = client.actions.list( - project_id="project_id", -) +response = client.actions.list() for item in response: yield item # alternatively, you can paginate page-by-page @@ -1268,14 +1189,6 @@ for page in response.iter_pages():
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **after:** `typing.Optional[str]` — The cursor to start from for pagination
@@ -1344,12 +1257,12 @@ for page in response.iter_pages(): from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.actions.retrieve( - project_id="project_id", component_id="component_id", ) @@ -1367,14 +1280,6 @@ client.actions.retrieve(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **component_id:** `str` — The key that uniquely identifies the component (e.g., 'slack-send-message')
@@ -1411,12 +1316,12 @@ client.actions.retrieve( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.actions.configure_prop( - project_id="project_id", id="id", external_user_id="external_user_id", prop_name="prop_name", @@ -1436,14 +1341,6 @@ client.actions.configure_prop(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **id:** `str` — The component ID
@@ -1560,12 +1457,12 @@ client.actions.configure_prop( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.actions.reload_props( - project_id="project_id", id="id", external_user_id="external_user_id", ) @@ -1584,14 +1481,6 @@ client.actions.reload_props(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **id:** `str` — The component ID
@@ -1676,12 +1565,12 @@ client.actions.reload_props( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.actions.run( - project_id="project_id", id="id", external_user_id="external_user_id", ) @@ -1700,14 +1589,6 @@ client.actions.run(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **id:** `str` — The action component ID
@@ -1777,13 +1658,12 @@ client.actions.run( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) -response = client.triggers.list( - project_id="project_id", -) +response = client.triggers.list() for item in response: yield item # alternatively, you can paginate page-by-page @@ -1804,14 +1684,6 @@ for page in response.iter_pages():
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **after:** `typing.Optional[str]` — The cursor to start from for pagination
@@ -1880,12 +1752,12 @@ for page in response.iter_pages(): from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.triggers.retrieve( - project_id="project_id", component_id="component_id", ) @@ -1903,14 +1775,6 @@ client.triggers.retrieve(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **component_id:** `str` — The key that uniquely identifies the component (e.g., 'slack-send-message')
@@ -1947,12 +1811,12 @@ client.triggers.retrieve( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.triggers.configure_prop( - project_id="project_id", id="id", external_user_id="external_user_id", prop_name="prop_name", @@ -1972,14 +1836,6 @@ client.triggers.configure_prop(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **id:** `str` — The component ID
@@ -2096,12 +1952,12 @@ client.triggers.configure_prop( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.triggers.reload_props( - project_id="project_id", id="id", external_user_id="external_user_id", ) @@ -2120,14 +1976,6 @@ client.triggers.reload_props(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **id:** `str` — The component ID
@@ -2212,12 +2060,12 @@ client.triggers.reload_props( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.triggers.deploy( - project_id="project_id", id="id", external_user_id="external_user_id", ) @@ -2236,14 +2084,6 @@ client.triggers.deploy(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **id:** `str` — The trigger component ID
@@ -2313,12 +2153,12 @@ client.triggers.deploy( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.deployed_triggers.list( - project_id="project_id", external_user_id="external_user_id", ) for item in response: @@ -2341,14 +2181,6 @@ for page in response.iter_pages():
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **external_user_id:** `str` — Your end user ID, for whom you deployed the trigger
@@ -2409,12 +2241,12 @@ for page in response.iter_pages(): from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.retrieve( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) @@ -2433,14 +2265,6 @@ client.deployed_triggers.retrieve(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **trigger_id:** `str`
@@ -2485,12 +2309,12 @@ client.deployed_triggers.retrieve( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.update( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) @@ -2509,14 +2333,6 @@ client.deployed_triggers.update(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **trigger_id:** `str`
@@ -2585,12 +2401,12 @@ client.deployed_triggers.update( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.delete( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) @@ -2609,14 +2425,6 @@ client.deployed_triggers.delete(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **trigger_id:** `str`
@@ -2669,12 +2477,12 @@ client.deployed_triggers.delete( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.list_events( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) @@ -2693,14 +2501,6 @@ client.deployed_triggers.list_events(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **trigger_id:** `str`
@@ -2753,12 +2553,12 @@ client.deployed_triggers.list_events( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.list_workflows( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) @@ -2777,14 +2577,6 @@ client.deployed_triggers.list_workflows(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **trigger_id:** `str`
@@ -2829,12 +2621,12 @@ client.deployed_triggers.list_workflows( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.update_workflows( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", workflow_ids=["workflow_ids"], @@ -2854,14 +2646,6 @@ client.deployed_triggers.update_workflows(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **trigger_id:** `str`
@@ -2914,12 +2698,12 @@ client.deployed_triggers.update_workflows( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.list_webhooks( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) @@ -2938,14 +2722,6 @@ client.deployed_triggers.list_webhooks(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **trigger_id:** `str`
@@ -2990,12 +2766,12 @@ client.deployed_triggers.list_webhooks( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.update_webhooks( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", webhook_urls=["webhook_urls"], @@ -3015,14 +2791,6 @@ client.deployed_triggers.update_webhooks(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **trigger_id:** `str`
@@ -3060,7 +2828,7 @@ client.deployed_triggers.update_webhooks( ## Projects -
client.projects.retrieve_info(...) +
client.projects.retrieve_info()
@@ -3076,13 +2844,12 @@ client.deployed_triggers.update_webhooks( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) -client.projects.retrieve_info( - project_id="project_id", -) +client.projects.retrieve_info() ```
@@ -3098,14 +2865,6 @@ client.projects.retrieve_info(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -3135,12 +2894,12 @@ client.projects.retrieve_info( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.proxy.get( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", @@ -3160,14 +2919,6 @@ client.proxy.get(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **url_64:** `str` — Base64-encoded target URL
@@ -3220,12 +2971,12 @@ client.proxy.get( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.proxy.post( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", @@ -3246,14 +2997,6 @@ client.proxy.post(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **url_64:** `str` — Base64-encoded target URL
@@ -3314,12 +3057,12 @@ client.proxy.post( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.proxy.put( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", @@ -3340,14 +3083,6 @@ client.proxy.put(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **url_64:** `str` — Base64-encoded target URL
@@ -3408,12 +3143,12 @@ client.proxy.put( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.proxy.delete( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", @@ -3433,14 +3168,6 @@ client.proxy.delete(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **url_64:** `str` — Base64-encoded target URL
@@ -3493,12 +3220,12 @@ client.proxy.delete( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.proxy.patch( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", @@ -3519,14 +3246,6 @@ client.proxy.patch(
-**project_id:** `str` — The project ID, which starts with 'proj_'. - -
-
- -
-
- **url_64:** `str` — Base64-encoded target URL
@@ -3588,6 +3307,7 @@ client.proxy.patch( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -3687,6 +3407,7 @@ client.tokens.create( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -3754,6 +3475,7 @@ client.tokens.validate( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", diff --git a/src/pipedream/accounts/client.py b/src/pipedream/accounts/client.py index bce7562..c42be65 100644 --- a/src/pipedream/accounts/client.py +++ b/src/pipedream/accounts/client.py @@ -29,7 +29,6 @@ def with_raw_response(self) -> RawAccountsClient: def list( self, - project_id: str, *, app_id: typing.Optional[str] = None, external_user_id: typing.Optional[str] = None, @@ -43,9 +42,6 @@ def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - app_id : typing.Optional[str] The app slug or ID to filter accounts by. @@ -79,13 +75,12 @@ def list( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) - response = client.accounts.list( - project_id="project_id", - ) + response = client.accounts.list() for item in response: yield item # alternatively, you can paginate page-by-page @@ -93,7 +88,6 @@ def list( yield page """ return self._raw_client.list( - project_id, app_id=app_id, external_user_id=external_user_id, oauth_app_id=oauth_app_id, @@ -106,7 +100,6 @@ def list( def create( self, - project_id: str, *, app_slug: str, cfmap_json: str, @@ -120,9 +113,6 @@ def create( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - app_slug : str The app slug for the account @@ -156,19 +146,18 @@ def create( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.accounts.create( - project_id="project_id", app_slug="app_slug", cfmap_json="cfmap_json", connect_token="connect_token", ) """ _response = self._raw_client.create( - project_id, app_slug=app_slug, cfmap_json=cfmap_json, connect_token=connect_token, @@ -182,7 +171,6 @@ def create( def retrieve( self, - project_id: str, account_id: str, *, include_credentials: typing.Optional[bool] = None, @@ -191,9 +179,6 @@ def retrieve( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - account_id : str include_credentials : typing.Optional[bool] @@ -212,29 +197,24 @@ def retrieve( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.accounts.retrieve( - project_id="project_id", account_id="account_id", ) """ _response = self._raw_client.retrieve( - project_id, account_id, include_credentials=include_credentials, request_options=request_options + account_id, include_credentials=include_credentials, request_options=request_options ) return _response.data - def delete( - self, project_id: str, account_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> None: + def delete(self, account_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - account_id : str request_options : typing.Optional[RequestOptions] @@ -249,27 +229,22 @@ def delete( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.accounts.delete( - project_id="project_id", account_id="account_id", ) """ - _response = self._raw_client.delete(project_id, account_id, request_options=request_options) + _response = self._raw_client.delete(account_id, request_options=request_options) return _response.data - def delete_by_app( - self, project_id: str, app_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> None: + def delete_by_app(self, app_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - app_id : str request_options : typing.Optional[RequestOptions] @@ -284,16 +259,16 @@ def delete_by_app( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.accounts.delete_by_app( - project_id="project_id", app_id="app_id", ) """ - _response = self._raw_client.delete_by_app(project_id, app_id, request_options=request_options) + _response = self._raw_client.delete_by_app(app_id, request_options=request_options) return _response.data @@ -314,7 +289,6 @@ def with_raw_response(self) -> AsyncRawAccountsClient: async def list( self, - project_id: str, *, app_id: typing.Optional[str] = None, external_user_id: typing.Optional[str] = None, @@ -328,9 +302,6 @@ async def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - app_id : typing.Optional[str] The app slug or ID to filter accounts by. @@ -366,6 +337,7 @@ async def list( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -373,9 +345,7 @@ async def list( async def main() -> None: - response = await client.accounts.list( - project_id="project_id", - ) + response = await client.accounts.list() async for item in response: yield item @@ -387,7 +357,6 @@ async def main() -> None: asyncio.run(main()) """ return await self._raw_client.list( - project_id, app_id=app_id, external_user_id=external_user_id, oauth_app_id=oauth_app_id, @@ -400,7 +369,6 @@ async def main() -> None: async def create( self, - project_id: str, *, app_slug: str, cfmap_json: str, @@ -414,9 +382,6 @@ async def create( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - app_slug : str The app slug for the account @@ -452,6 +417,7 @@ async def create( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -460,7 +426,6 @@ async def create( async def main() -> None: await client.accounts.create( - project_id="project_id", app_slug="app_slug", cfmap_json="cfmap_json", connect_token="connect_token", @@ -470,7 +435,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.create( - project_id, app_slug=app_slug, cfmap_json=cfmap_json, connect_token=connect_token, @@ -484,7 +448,6 @@ async def main() -> None: async def retrieve( self, - project_id: str, account_id: str, *, include_credentials: typing.Optional[bool] = None, @@ -493,9 +456,6 @@ async def retrieve( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - account_id : str include_credentials : typing.Optional[bool] @@ -516,6 +476,7 @@ async def retrieve( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -524,7 +485,6 @@ async def retrieve( async def main() -> None: await client.accounts.retrieve( - project_id="project_id", account_id="account_id", ) @@ -532,19 +492,14 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.retrieve( - project_id, account_id, include_credentials=include_credentials, request_options=request_options + account_id, include_credentials=include_credentials, request_options=request_options ) return _response.data - async def delete( - self, project_id: str, account_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> None: + async def delete(self, account_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - account_id : str request_options : typing.Optional[RequestOptions] @@ -561,6 +516,7 @@ async def delete( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -569,25 +525,19 @@ async def delete( async def main() -> None: await client.accounts.delete( - project_id="project_id", account_id="account_id", ) asyncio.run(main()) """ - _response = await self._raw_client.delete(project_id, account_id, request_options=request_options) + _response = await self._raw_client.delete(account_id, request_options=request_options) return _response.data - async def delete_by_app( - self, project_id: str, app_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> None: + async def delete_by_app(self, app_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - app_id : str request_options : typing.Optional[RequestOptions] @@ -604,6 +554,7 @@ async def delete_by_app( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -612,12 +563,11 @@ async def delete_by_app( async def main() -> None: await client.accounts.delete_by_app( - project_id="project_id", app_id="app_id", ) asyncio.run(main()) """ - _response = await self._raw_client.delete_by_app(project_id, app_id, request_options=request_options) + _response = await self._raw_client.delete_by_app(app_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 8f5b61f..2767afd 100644 --- a/src/pipedream/accounts/raw_client.py +++ b/src/pipedream/accounts/raw_client.py @@ -23,7 +23,6 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def list( self, - project_id: str, *, app_id: typing.Optional[str] = None, external_user_id: typing.Optional[str] = None, @@ -37,9 +36,6 @@ def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - app_id : typing.Optional[str] The app slug or ID to filter accounts by. @@ -69,7 +65,7 @@ def list( accounts listed """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/accounts", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/accounts", method="GET", params={ "app_id": app_id, @@ -98,7 +94,6 @@ 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( - project_id, app_id=app_id, external_user_id=external_user_id, oauth_app_id=oauth_app_id, @@ -118,7 +113,6 @@ def list( def create( self, - project_id: str, *, app_slug: str, cfmap_json: str, @@ -132,9 +126,6 @@ def create( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - app_slug : str The app slug for the account @@ -164,7 +155,7 @@ def create( account created """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/accounts", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/accounts", method="POST", params={ "app_id": app_id, @@ -200,7 +191,6 @@ def create( def retrieve( self, - project_id: str, account_id: str, *, include_credentials: typing.Optional[bool] = None, @@ -209,9 +199,6 @@ def retrieve( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - account_id : str include_credentials : typing.Optional[bool] @@ -226,7 +213,7 @@ def retrieve( account retrieved """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/accounts/{jsonable_encoder(account_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/accounts/{jsonable_encoder(account_id)}", method="GET", params={ "include_credentials": include_credentials, @@ -248,15 +235,10 @@ def retrieve( 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) - def delete( - self, project_id: str, account_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[None]: + def delete(self, account_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - account_id : str request_options : typing.Optional[RequestOptions] @@ -267,7 +249,7 @@ def delete( HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/accounts/{jsonable_encoder(account_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/accounts/{jsonable_encoder(account_id)}", method="DELETE", request_options=request_options, ) @@ -280,14 +262,11 @@ def delete( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete_by_app( - self, project_id: str, app_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, app_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[None]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - app_id : str request_options : typing.Optional[RequestOptions] @@ -298,7 +277,7 @@ def delete_by_app( HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/apps/{jsonable_encoder(app_id)}/accounts", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/apps/{jsonable_encoder(app_id)}/accounts", method="DELETE", request_options=request_options, ) @@ -317,7 +296,6 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def list( self, - project_id: str, *, app_id: typing.Optional[str] = None, external_user_id: typing.Optional[str] = None, @@ -331,9 +309,6 @@ async def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - app_id : typing.Optional[str] The app slug or ID to filter accounts by. @@ -363,7 +338,7 @@ async def list( accounts listed """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/accounts", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/accounts", method="GET", params={ "app_id": app_id, @@ -394,7 +369,6 @@ async def list( async def _get_next(): return await self.list( - project_id, app_id=app_id, external_user_id=external_user_id, oauth_app_id=oauth_app_id, @@ -415,7 +389,6 @@ async def _get_next(): async def create( self, - project_id: str, *, app_slug: str, cfmap_json: str, @@ -429,9 +402,6 @@ async def create( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - app_slug : str The app slug for the account @@ -461,7 +431,7 @@ async def create( account created """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/accounts", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/accounts", method="POST", params={ "app_id": app_id, @@ -497,7 +467,6 @@ async def create( async def retrieve( self, - project_id: str, account_id: str, *, include_credentials: typing.Optional[bool] = None, @@ -506,9 +475,6 @@ async def retrieve( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - account_id : str include_credentials : typing.Optional[bool] @@ -523,7 +489,7 @@ async def retrieve( account retrieved """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/accounts/{jsonable_encoder(account_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/accounts/{jsonable_encoder(account_id)}", method="GET", params={ "include_credentials": include_credentials, @@ -546,14 +512,11 @@ async def retrieve( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( - self, project_id: str, account_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, account_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - account_id : str request_options : typing.Optional[RequestOptions] @@ -564,7 +527,7 @@ async def delete( AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/accounts/{jsonable_encoder(account_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/accounts/{jsonable_encoder(account_id)}", method="DELETE", request_options=request_options, ) @@ -577,14 +540,11 @@ async def delete( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete_by_app( - self, project_id: str, app_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, app_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - app_id : str request_options : typing.Optional[RequestOptions] @@ -595,7 +555,7 @@ async def delete_by_app( AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/apps/{jsonable_encoder(app_id)}/accounts", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/apps/{jsonable_encoder(app_id)}/accounts", method="DELETE", request_options=request_options, ) diff --git a/src/pipedream/actions/client.py b/src/pipedream/actions/client.py index 55f4d68..a5dd0d7 100644 --- a/src/pipedream/actions/client.py +++ b/src/pipedream/actions/client.py @@ -32,7 +32,6 @@ def with_raw_response(self) -> RawActionsClient: def list( self, - project_id: str, *, after: typing.Optional[str] = None, before: typing.Optional[str] = None, @@ -44,9 +43,6 @@ def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - after : typing.Optional[str] The cursor to start from for pagination @@ -75,13 +71,12 @@ def list( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) - response = client.actions.list( - project_id="project_id", - ) + response = client.actions.list() for item in response: yield item # alternatively, you can paginate page-by-page @@ -89,18 +84,13 @@ def list( yield page """ return self._raw_client.list( - project_id, after=after, before=before, limit=limit, q=q, app=app, request_options=request_options + after=after, before=before, limit=limit, q=q, app=app, request_options=request_options ) - def retrieve( - self, project_id: str, component_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> Component: + def retrieve(self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Component: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') @@ -117,21 +107,20 @@ def retrieve( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.actions.retrieve( - project_id="project_id", component_id="component_id", ) """ - _response = self._raw_client.retrieve(project_id, component_id, request_options=request_options) + _response = self._raw_client.retrieve(component_id, request_options=request_options) return _response.data def configure_prop( self, - project_id: str, *, id: str, external_user_id: str, @@ -149,9 +138,6 @@ def configure_prop( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -197,19 +183,18 @@ def configure_prop( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.actions.configure_prop( - project_id="project_id", id="id", external_user_id="external_user_id", prop_name="prop_name", ) """ _response = self._raw_client.configure_prop( - project_id, id=id, external_user_id=external_user_id, prop_name=prop_name, @@ -227,7 +212,6 @@ def configure_prop( def reload_props( self, - project_id: str, *, id: str, external_user_id: str, @@ -241,9 +225,6 @@ def reload_props( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -277,18 +258,17 @@ def reload_props( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.actions.reload_props( - project_id="project_id", id="id", external_user_id="external_user_id", ) """ _response = self._raw_client.reload_props( - project_id, id=id, external_user_id=external_user_id, async_handle=async_handle, @@ -302,7 +282,6 @@ def reload_props( def run( self, - project_id: str, *, id: str, external_user_id: str, @@ -314,9 +293,6 @@ def run( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The action component ID @@ -344,18 +320,17 @@ def run( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.actions.run( - project_id="project_id", id="id", external_user_id="external_user_id", ) """ _response = self._raw_client.run( - project_id, id=id, external_user_id=external_user_id, async_handle=async_handle, @@ -383,7 +358,6 @@ def with_raw_response(self) -> AsyncRawActionsClient: async def list( self, - project_id: str, *, after: typing.Optional[str] = None, before: typing.Optional[str] = None, @@ -395,9 +369,6 @@ async def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - after : typing.Optional[str] The cursor to start from for pagination @@ -428,6 +399,7 @@ async def list( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -435,9 +407,7 @@ async def list( async def main() -> None: - response = await client.actions.list( - project_id="project_id", - ) + response = await client.actions.list() async for item in response: yield item @@ -449,18 +419,15 @@ async def main() -> None: asyncio.run(main()) """ return await self._raw_client.list( - project_id, after=after, before=before, limit=limit, q=q, app=app, request_options=request_options + after=after, before=before, limit=limit, q=q, app=app, request_options=request_options ) async def retrieve( - self, project_id: str, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> Component: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') @@ -479,6 +446,7 @@ async def retrieve( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -487,19 +455,17 @@ async def retrieve( async def main() -> None: await client.actions.retrieve( - project_id="project_id", component_id="component_id", ) asyncio.run(main()) """ - _response = await self._raw_client.retrieve(project_id, component_id, request_options=request_options) + _response = await self._raw_client.retrieve(component_id, request_options=request_options) return _response.data async def configure_prop( self, - project_id: str, *, id: str, external_user_id: str, @@ -517,9 +483,6 @@ async def configure_prop( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -567,6 +530,7 @@ async def configure_prop( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -575,7 +539,6 @@ async def configure_prop( async def main() -> None: await client.actions.configure_prop( - project_id="project_id", id="id", external_user_id="external_user_id", prop_name="prop_name", @@ -585,7 +548,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.configure_prop( - project_id, id=id, external_user_id=external_user_id, prop_name=prop_name, @@ -603,7 +565,6 @@ async def main() -> None: async def reload_props( self, - project_id: str, *, id: str, external_user_id: str, @@ -617,9 +578,6 @@ async def reload_props( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -655,6 +613,7 @@ async def reload_props( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -663,7 +622,6 @@ async def reload_props( async def main() -> None: await client.actions.reload_props( - project_id="project_id", id="id", external_user_id="external_user_id", ) @@ -672,7 +630,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.reload_props( - project_id, id=id, external_user_id=external_user_id, async_handle=async_handle, @@ -686,7 +643,6 @@ async def main() -> None: async def run( self, - project_id: str, *, id: str, external_user_id: str, @@ -698,9 +654,6 @@ async def run( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The action component ID @@ -730,6 +683,7 @@ async def run( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -738,7 +692,6 @@ async def run( async def main() -> None: await client.actions.run( - project_id="project_id", id="id", external_user_id="external_user_id", ) @@ -747,7 +700,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.run( - project_id, id=id, external_user_id=external_user_id, async_handle=async_handle, diff --git a/src/pipedream/actions/raw_client.py b/src/pipedream/actions/raw_client.py index 5da94c5..2465c23 100644 --- a/src/pipedream/actions/raw_client.py +++ b/src/pipedream/actions/raw_client.py @@ -27,7 +27,6 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def list( self, - project_id: str, *, after: typing.Optional[str] = None, before: typing.Optional[str] = None, @@ -39,9 +38,6 @@ def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - after : typing.Optional[str] The cursor to start from for pagination @@ -66,7 +62,7 @@ def list( actions listed """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/actions", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/actions", method="GET", params={ "after": after, @@ -93,7 +89,6 @@ 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( - project_id, after=_parsed_next, before=before, limit=limit, @@ -110,14 +105,11 @@ def list( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def retrieve( - self, project_id: str, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[Component]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') @@ -130,7 +122,7 @@ def retrieve( action retrieved """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/actions/{jsonable_encoder(component_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/actions/{jsonable_encoder(component_id)}", method="GET", request_options=request_options, ) @@ -152,7 +144,6 @@ def retrieve( def configure_prop( self, - project_id: str, *, id: str, external_user_id: str, @@ -170,9 +161,6 @@ def configure_prop( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -214,7 +202,7 @@ def configure_prop( action configuration started """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/actions/configure", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/actions/configure", method="POST", json={ "id": id, @@ -252,7 +240,6 @@ def configure_prop( def reload_props( self, - project_id: str, *, id: str, external_user_id: str, @@ -266,9 +253,6 @@ def reload_props( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -298,7 +282,7 @@ def reload_props( action props reloaded """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/actions/props", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/actions/props", method="POST", json={ "id": id, @@ -332,7 +316,6 @@ def reload_props( def run( self, - project_id: str, *, id: str, external_user_id: str, @@ -344,9 +327,6 @@ def run( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The action component ID @@ -370,7 +350,7 @@ def run( action ran """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/actions/run", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/actions/run", method="POST", json={ "id": id, @@ -407,7 +387,6 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def list( self, - project_id: str, *, after: typing.Optional[str] = None, before: typing.Optional[str] = None, @@ -419,9 +398,6 @@ async def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - after : typing.Optional[str] The cursor to start from for pagination @@ -446,7 +422,7 @@ async def list( actions listed """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/actions", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/actions", method="GET", params={ "after": after, @@ -475,7 +451,6 @@ async def list( async def _get_next(): return await self.list( - project_id, after=_parsed_next, before=before, limit=limit, @@ -493,14 +468,11 @@ async def _get_next(): raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def retrieve( - self, project_id: str, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[Component]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') @@ -513,7 +485,7 @@ async def retrieve( action retrieved """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/actions/{jsonable_encoder(component_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/actions/{jsonable_encoder(component_id)}", method="GET", request_options=request_options, ) @@ -535,7 +507,6 @@ async def retrieve( async def configure_prop( self, - project_id: str, *, id: str, external_user_id: str, @@ -553,9 +524,6 @@ async def configure_prop( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -597,7 +565,7 @@ async def configure_prop( action configuration started """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/actions/configure", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/actions/configure", method="POST", json={ "id": id, @@ -635,7 +603,6 @@ async def configure_prop( async def reload_props( self, - project_id: str, *, id: str, external_user_id: str, @@ -649,9 +616,6 @@ async def reload_props( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -681,7 +645,7 @@ async def reload_props( action props reloaded """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/actions/props", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/actions/props", method="POST", json={ "id": id, @@ -715,7 +679,6 @@ async def reload_props( async def run( self, - project_id: str, *, id: str, external_user_id: str, @@ -727,9 +690,6 @@ async def run( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The action component ID @@ -753,7 +713,7 @@ async def run( action ran """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/actions/run", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/actions/run", method="POST", json={ "id": id, diff --git a/src/pipedream/app_categories/client.py b/src/pipedream/app_categories/client.py index 7079f95..1a15edd 100644 --- a/src/pipedream/app_categories/client.py +++ b/src/pipedream/app_categories/client.py @@ -41,6 +41,7 @@ def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> Li from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -70,6 +71,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -116,6 +118,7 @@ async def list(self, *, request_options: typing.Optional[RequestOptions] = None) from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -155,6 +158,7 @@ async def retrieve( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", diff --git a/src/pipedream/apps/client.py b/src/pipedream/apps/client.py index 7b0556a..1256037 100644 --- a/src/pipedream/apps/client.py +++ b/src/pipedream/apps/client.py @@ -76,6 +76,7 @@ def list( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -118,6 +119,7 @@ def retrieve(self, app_id: str, *, request_options: typing.Optional[RequestOptio from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -196,6 +198,7 @@ async def list( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -247,6 +250,7 @@ async def retrieve(self, app_id: str, *, request_options: typing.Optional[Reques from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", diff --git a/src/pipedream/client.py b/src/pipedream/client.py index 8ba6924..58505a9 100644 --- a/src/pipedream/client.py +++ b/src/pipedream/client.py @@ -38,6 +38,7 @@ class Client: + project_id : str x_pd_environment : typing.Optional[str] client_id : str client_secret : str @@ -56,6 +57,7 @@ class Client: from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -67,6 +69,7 @@ def __init__( *, base_url: typing.Optional[str] = None, environment: PipedreamEnvironment = PipedreamEnvironment.PROD, + project_id: str, x_pd_environment: typing.Optional[str] = None, client_id: str, client_secret: str, @@ -83,6 +86,7 @@ def __init__( client_secret=client_secret, client_wrapper=SyncClientWrapper( base_url=_get_base_url(base_url=base_url, environment=environment), + project_id=project_id, x_pd_environment=x_pd_environment, httpx_client=httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects) if follow_redirects is not None @@ -92,6 +96,7 @@ def __init__( ) self._client_wrapper = SyncClientWrapper( base_url=_get_base_url(base_url=base_url, environment=environment), + project_id=project_id, x_pd_environment=x_pd_environment, token=_token_getter_override if _token_getter_override is not None else oauth_token_provider.get_token, httpx_client=httpx_client @@ -133,6 +138,7 @@ class AsyncClient: + project_id : str x_pd_environment : typing.Optional[str] client_id : str client_secret : str @@ -151,6 +157,7 @@ class AsyncClient: from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -162,6 +169,7 @@ def __init__( *, base_url: typing.Optional[str] = None, environment: PipedreamEnvironment = PipedreamEnvironment.PROD, + project_id: str, x_pd_environment: typing.Optional[str] = None, client_id: str, client_secret: str, @@ -178,6 +186,7 @@ def __init__( client_secret=client_secret, client_wrapper=SyncClientWrapper( base_url=_get_base_url(base_url=base_url, environment=environment), + project_id=project_id, x_pd_environment=x_pd_environment, httpx_client=httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects) if follow_redirects is not None @@ -187,6 +196,7 @@ def __init__( ) self._client_wrapper = AsyncClientWrapper( base_url=_get_base_url(base_url=base_url, environment=environment), + project_id=project_id, x_pd_environment=x_pd_environment, token=_token_getter_override if _token_getter_override is not None else oauth_token_provider.get_token, httpx_client=httpx_client diff --git a/src/pipedream/components/client.py b/src/pipedream/components/client.py index 56ab9c7..5df8730 100644 --- a/src/pipedream/components/client.py +++ b/src/pipedream/components/client.py @@ -31,7 +31,6 @@ def with_raw_response(self) -> RawComponentsClient: def list( self, - project_id: str, *, after: typing.Optional[str] = None, before: typing.Optional[str] = None, @@ -43,9 +42,6 @@ def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - after : typing.Optional[str] The cursor to start from for pagination @@ -74,13 +70,12 @@ def list( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) - response = client.components.list( - project_id="project_id", - ) + response = client.components.list() for item in response: yield item # alternatively, you can paginate page-by-page @@ -88,18 +83,13 @@ def list( yield page """ return self._raw_client.list( - project_id, after=after, before=before, limit=limit, q=q, app=app, request_options=request_options + after=after, before=before, limit=limit, q=q, app=app, request_options=request_options ) - def retrieve( - self, project_id: str, component_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> Component: + def retrieve(self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Component: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') @@ -116,21 +106,20 @@ def retrieve( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.components.retrieve( - project_id="project_id", component_id="component_id", ) """ - _response = self._raw_client.retrieve(project_id, component_id, request_options=request_options) + _response = self._raw_client.retrieve(component_id, request_options=request_options) return _response.data def configure_prop( self, - project_id: str, *, id: str, external_user_id: str, @@ -148,9 +137,6 @@ def configure_prop( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -196,19 +182,18 @@ def configure_prop( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.components.configure_prop( - project_id="project_id", id="id", external_user_id="external_user_id", prop_name="prop_name", ) """ _response = self._raw_client.configure_prop( - project_id, id=id, external_user_id=external_user_id, prop_name=prop_name, @@ -226,7 +211,6 @@ def configure_prop( def reload_props( self, - project_id: str, *, id: str, external_user_id: str, @@ -240,9 +224,6 @@ def reload_props( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -276,18 +257,17 @@ def reload_props( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.components.reload_props( - project_id="project_id", id="id", external_user_id="external_user_id", ) """ _response = self._raw_client.reload_props( - project_id, id=id, external_user_id=external_user_id, async_handle=async_handle, @@ -317,7 +297,6 @@ def with_raw_response(self) -> AsyncRawComponentsClient: async def list( self, - project_id: str, *, after: typing.Optional[str] = None, before: typing.Optional[str] = None, @@ -329,9 +308,6 @@ async def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - after : typing.Optional[str] The cursor to start from for pagination @@ -362,6 +338,7 @@ async def list( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -369,9 +346,7 @@ async def list( async def main() -> None: - response = await client.components.list( - project_id="project_id", - ) + response = await client.components.list() async for item in response: yield item @@ -383,18 +358,15 @@ async def main() -> None: asyncio.run(main()) """ return await self._raw_client.list( - project_id, after=after, before=before, limit=limit, q=q, app=app, request_options=request_options + after=after, before=before, limit=limit, q=q, app=app, request_options=request_options ) async def retrieve( - self, project_id: str, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> Component: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') @@ -413,6 +385,7 @@ async def retrieve( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -421,19 +394,17 @@ async def retrieve( async def main() -> None: await client.components.retrieve( - project_id="project_id", component_id="component_id", ) asyncio.run(main()) """ - _response = await self._raw_client.retrieve(project_id, component_id, request_options=request_options) + _response = await self._raw_client.retrieve(component_id, request_options=request_options) return _response.data async def configure_prop( self, - project_id: str, *, id: str, external_user_id: str, @@ -451,9 +422,6 @@ async def configure_prop( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -501,6 +469,7 @@ async def configure_prop( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -509,7 +478,6 @@ async def configure_prop( async def main() -> None: await client.components.configure_prop( - project_id="project_id", id="id", external_user_id="external_user_id", prop_name="prop_name", @@ -519,7 +487,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.configure_prop( - project_id, id=id, external_user_id=external_user_id, prop_name=prop_name, @@ -537,7 +504,6 @@ async def main() -> None: async def reload_props( self, - project_id: str, *, id: str, external_user_id: str, @@ -551,9 +517,6 @@ async def reload_props( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -589,6 +552,7 @@ async def reload_props( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -597,7 +561,6 @@ async def reload_props( async def main() -> None: await client.components.reload_props( - project_id="project_id", id="id", external_user_id="external_user_id", ) @@ -606,7 +569,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.reload_props( - project_id, id=id, external_user_id=external_user_id, async_handle=async_handle, diff --git a/src/pipedream/components/raw_client.py b/src/pipedream/components/raw_client.py index 0179903..180f32c 100644 --- a/src/pipedream/components/raw_client.py +++ b/src/pipedream/components/raw_client.py @@ -26,7 +26,6 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def list( self, - project_id: str, *, after: typing.Optional[str] = None, before: typing.Optional[str] = None, @@ -38,9 +37,6 @@ def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - after : typing.Optional[str] The cursor to start from for pagination @@ -65,7 +61,7 @@ def list( components listed """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/components", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/components", method="GET", params={ "after": after, @@ -92,7 +88,6 @@ 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( - project_id, after=_parsed_next, before=before, limit=limit, @@ -109,14 +104,11 @@ def list( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def retrieve( - self, project_id: str, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[Component]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') @@ -129,7 +121,7 @@ def retrieve( component retrieved """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/components/{jsonable_encoder(component_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/components/{jsonable_encoder(component_id)}", method="GET", request_options=request_options, ) @@ -151,7 +143,6 @@ def retrieve( def configure_prop( self, - project_id: str, *, id: str, external_user_id: str, @@ -169,9 +160,6 @@ def configure_prop( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -213,7 +201,7 @@ def configure_prop( component configuration started """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/components/configure", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/components/configure", method="POST", json={ "id": id, @@ -251,7 +239,6 @@ def configure_prop( def reload_props( self, - project_id: str, *, id: str, external_user_id: str, @@ -265,9 +252,6 @@ def reload_props( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -297,7 +281,7 @@ def reload_props( component props reloaded """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/components/props", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/components/props", method="POST", json={ "id": id, @@ -336,7 +320,6 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def list( self, - project_id: str, *, after: typing.Optional[str] = None, before: typing.Optional[str] = None, @@ -348,9 +331,6 @@ async def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - after : typing.Optional[str] The cursor to start from for pagination @@ -375,7 +355,7 @@ async def list( components listed """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/components", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/components", method="GET", params={ "after": after, @@ -404,7 +384,6 @@ async def list( async def _get_next(): return await self.list( - project_id, after=_parsed_next, before=before, limit=limit, @@ -422,14 +401,11 @@ async def _get_next(): raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def retrieve( - self, project_id: str, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[Component]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') @@ -442,7 +418,7 @@ async def retrieve( component retrieved """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/components/{jsonable_encoder(component_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/components/{jsonable_encoder(component_id)}", method="GET", request_options=request_options, ) @@ -464,7 +440,6 @@ async def retrieve( async def configure_prop( self, - project_id: str, *, id: str, external_user_id: str, @@ -482,9 +457,6 @@ async def configure_prop( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -526,7 +498,7 @@ async def configure_prop( component configuration started """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/components/configure", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/components/configure", method="POST", json={ "id": id, @@ -564,7 +536,6 @@ async def configure_prop( async def reload_props( self, - project_id: str, *, id: str, external_user_id: str, @@ -578,9 +549,6 @@ async def reload_props( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -610,7 +578,7 @@ async def reload_props( component props reloaded """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/components/props", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/components/props", method="POST", json={ "id": id, diff --git a/src/pipedream/core/client_wrapper.py b/src/pipedream/core/client_wrapper.py index 4a6c2b8..1dcf256 100644 --- a/src/pipedream/core/client_wrapper.py +++ b/src/pipedream/core/client_wrapper.py @@ -10,12 +10,14 @@ class BaseClientWrapper: def __init__( self, *, + project_id: str, x_pd_environment: typing.Optional[str] = None, token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, headers: typing.Optional[typing.Dict[str, str]] = None, base_url: str, timeout: typing.Optional[float] = None, ): + self._project_id = project_id self._x_pd_environment = x_pd_environment self._token = token self._headers = headers @@ -57,6 +59,7 @@ class SyncClientWrapper(BaseClientWrapper): def __init__( self, *, + project_id: str, x_pd_environment: typing.Optional[str] = None, token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, headers: typing.Optional[typing.Dict[str, str]] = None, @@ -65,7 +68,12 @@ def __init__( httpx_client: httpx.Client, ): super().__init__( - x_pd_environment=x_pd_environment, token=token, headers=headers, base_url=base_url, timeout=timeout + project_id=project_id, + x_pd_environment=x_pd_environment, + token=token, + headers=headers, + base_url=base_url, + timeout=timeout, ) self.httpx_client = HttpClient( httpx_client=httpx_client, @@ -79,6 +87,7 @@ class AsyncClientWrapper(BaseClientWrapper): def __init__( self, *, + project_id: str, x_pd_environment: typing.Optional[str] = None, token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, headers: typing.Optional[typing.Dict[str, str]] = None, @@ -87,7 +96,12 @@ def __init__( httpx_client: httpx.AsyncClient, ): super().__init__( - x_pd_environment=x_pd_environment, token=token, headers=headers, base_url=base_url, timeout=timeout + project_id=project_id, + x_pd_environment=x_pd_environment, + token=token, + headers=headers, + base_url=base_url, + timeout=timeout, ) self.httpx_client = AsyncHttpClient( httpx_client=httpx_client, diff --git a/src/pipedream/deployed_triggers/client.py b/src/pipedream/deployed_triggers/client.py index 0535ef7..8482f8e 100644 --- a/src/pipedream/deployed_triggers/client.py +++ b/src/pipedream/deployed_triggers/client.py @@ -32,7 +32,6 @@ def with_raw_response(self) -> RawDeployedTriggersClient: def list( self, - project_id: str, *, external_user_id: str, after: typing.Optional[str] = None, @@ -43,9 +42,6 @@ def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - external_user_id : str Your end user ID, for whom you deployed the trigger @@ -71,12 +67,12 @@ def list( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.deployed_triggers.list( - project_id="project_id", external_user_id="external_user_id", ) for item in response: @@ -86,28 +82,15 @@ def list( yield page """ return self._raw_client.list( - project_id, - 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, request_options=request_options ) def retrieve( - self, - project_id: str, - trigger_id: str, - *, - external_user_id: str, - request_options: typing.Optional[RequestOptions] = None, + self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None ) -> DeployedComponent: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -126,24 +109,23 @@ def retrieve( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.retrieve( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) """ _response = self._raw_client.retrieve( - project_id, trigger_id, external_user_id=external_user_id, request_options=request_options + trigger_id, external_user_id=external_user_id, request_options=request_options ) return _response.data def update( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -155,9 +137,6 @@ def update( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -185,18 +164,17 @@ def update( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.update( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) """ _response = self._raw_client.update( - project_id, trigger_id, external_user_id=external_user_id, active=active, @@ -208,7 +186,6 @@ def update( def delete( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -218,9 +195,6 @@ def delete( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -241,18 +215,17 @@ def delete( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.delete( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) """ _response = self._raw_client.delete( - project_id, trigger_id, external_user_id=external_user_id, ignore_hook_errors=ignore_hook_errors, @@ -262,7 +235,6 @@ def delete( def list_events( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -272,9 +244,6 @@ def list_events( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -296,35 +265,27 @@ def list_events( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.list_events( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) """ _response = self._raw_client.list_events( - project_id, trigger_id, external_user_id=external_user_id, n=n, request_options=request_options + trigger_id, external_user_id=external_user_id, n=n, request_options=request_options ) return _response.data def list_workflows( - self, - project_id: str, - trigger_id: str, - *, - external_user_id: str, - request_options: typing.Optional[RequestOptions] = None, + self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None ) -> GetTriggerWorkflowsResponse: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -343,24 +304,23 @@ def list_workflows( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.list_workflows( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) """ _response = self._raw_client.list_workflows( - project_id, trigger_id, external_user_id=external_user_id, request_options=request_options + trigger_id, external_user_id=external_user_id, request_options=request_options ) return _response.data def update_workflows( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -370,9 +330,6 @@ def update_workflows( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -394,40 +351,28 @@ def update_workflows( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.update_workflows( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", workflow_ids=["workflow_ids"], ) """ _response = self._raw_client.update_workflows( - project_id, - trigger_id, - external_user_id=external_user_id, - workflow_ids=workflow_ids, - request_options=request_options, + trigger_id, external_user_id=external_user_id, workflow_ids=workflow_ids, request_options=request_options ) return _response.data def list_webhooks( - self, - project_id: str, - trigger_id: str, - *, - external_user_id: str, - request_options: typing.Optional[RequestOptions] = None, + self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None ) -> GetTriggerWebhooksResponse: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -446,24 +391,23 @@ def list_webhooks( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.list_webhooks( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) """ _response = self._raw_client.list_webhooks( - project_id, trigger_id, external_user_id=external_user_id, request_options=request_options + trigger_id, external_user_id=external_user_id, request_options=request_options ) return _response.data def update_webhooks( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -473,9 +417,6 @@ def update_webhooks( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -497,23 +438,19 @@ def update_webhooks( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.deployed_triggers.update_webhooks( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", webhook_urls=["webhook_urls"], ) """ _response = self._raw_client.update_webhooks( - project_id, - trigger_id, - external_user_id=external_user_id, - webhook_urls=webhook_urls, - request_options=request_options, + trigger_id, external_user_id=external_user_id, webhook_urls=webhook_urls, request_options=request_options ) return _response.data @@ -535,7 +472,6 @@ def with_raw_response(self) -> AsyncRawDeployedTriggersClient: async def list( self, - project_id: str, *, external_user_id: str, after: typing.Optional[str] = None, @@ -546,9 +482,6 @@ async def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - external_user_id : str Your end user ID, for whom you deployed the trigger @@ -576,6 +509,7 @@ async def list( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -584,7 +518,6 @@ async def list( async def main() -> None: response = await client.deployed_triggers.list( - project_id="project_id", external_user_id="external_user_id", ) async for item in response: @@ -598,28 +531,15 @@ async def main() -> None: asyncio.run(main()) """ return await self._raw_client.list( - project_id, - 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, request_options=request_options ) async def retrieve( - self, - project_id: str, - trigger_id: str, - *, - external_user_id: str, - request_options: typing.Optional[RequestOptions] = None, + self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None ) -> DeployedComponent: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -640,6 +560,7 @@ async def retrieve( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -648,7 +569,6 @@ async def retrieve( async def main() -> None: await client.deployed_triggers.retrieve( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) @@ -657,13 +577,12 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.retrieve( - project_id, trigger_id, external_user_id=external_user_id, request_options=request_options + trigger_id, external_user_id=external_user_id, request_options=request_options ) return _response.data async def update( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -675,9 +594,6 @@ async def update( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -707,6 +623,7 @@ async def update( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -715,7 +632,6 @@ async def update( async def main() -> None: await client.deployed_triggers.update( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) @@ -724,7 +640,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.update( - project_id, trigger_id, external_user_id=external_user_id, active=active, @@ -736,7 +651,6 @@ async def main() -> None: async def delete( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -746,9 +660,6 @@ async def delete( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -771,6 +682,7 @@ async def delete( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -779,7 +691,6 @@ async def delete( async def main() -> None: await client.deployed_triggers.delete( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) @@ -788,7 +699,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.delete( - project_id, trigger_id, external_user_id=external_user_id, ignore_hook_errors=ignore_hook_errors, @@ -798,7 +708,6 @@ async def main() -> None: async def list_events( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -808,9 +717,6 @@ async def list_events( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -834,6 +740,7 @@ async def list_events( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -842,7 +749,6 @@ async def list_events( async def main() -> None: await client.deployed_triggers.list_events( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) @@ -851,24 +757,16 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.list_events( - project_id, trigger_id, external_user_id=external_user_id, n=n, request_options=request_options + trigger_id, external_user_id=external_user_id, n=n, request_options=request_options ) return _response.data async def list_workflows( - self, - project_id: str, - trigger_id: str, - *, - external_user_id: str, - request_options: typing.Optional[RequestOptions] = None, + self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None ) -> GetTriggerWorkflowsResponse: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -889,6 +787,7 @@ async def list_workflows( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -897,7 +796,6 @@ async def list_workflows( async def main() -> None: await client.deployed_triggers.list_workflows( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) @@ -906,13 +804,12 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.list_workflows( - project_id, trigger_id, external_user_id=external_user_id, request_options=request_options + trigger_id, external_user_id=external_user_id, request_options=request_options ) return _response.data async def update_workflows( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -922,9 +819,6 @@ async def update_workflows( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -948,6 +842,7 @@ async def update_workflows( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -956,7 +851,6 @@ async def update_workflows( async def main() -> None: await client.deployed_triggers.update_workflows( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", workflow_ids=["workflow_ids"], @@ -966,28 +860,16 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.update_workflows( - project_id, - trigger_id, - external_user_id=external_user_id, - workflow_ids=workflow_ids, - request_options=request_options, + trigger_id, external_user_id=external_user_id, workflow_ids=workflow_ids, request_options=request_options ) return _response.data async def list_webhooks( - self, - project_id: str, - trigger_id: str, - *, - external_user_id: str, - request_options: typing.Optional[RequestOptions] = None, + self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None ) -> GetTriggerWebhooksResponse: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -1008,6 +890,7 @@ async def list_webhooks( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -1016,7 +899,6 @@ async def list_webhooks( async def main() -> None: await client.deployed_triggers.list_webhooks( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", ) @@ -1025,13 +907,12 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.list_webhooks( - project_id, trigger_id, external_user_id=external_user_id, request_options=request_options + trigger_id, external_user_id=external_user_id, request_options=request_options ) return _response.data async def update_webhooks( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -1041,9 +922,6 @@ async def update_webhooks( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -1067,6 +945,7 @@ async def update_webhooks( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -1075,7 +954,6 @@ async def update_webhooks( async def main() -> None: await client.deployed_triggers.update_webhooks( - project_id="project_id", trigger_id="trigger_id", external_user_id="external_user_id", webhook_urls=["webhook_urls"], @@ -1085,10 +963,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.update_webhooks( - project_id, - trigger_id, - external_user_id=external_user_id, - webhook_urls=webhook_urls, - request_options=request_options, + trigger_id, external_user_id=external_user_id, webhook_urls=webhook_urls, request_options=request_options ) return _response.data diff --git a/src/pipedream/deployed_triggers/raw_client.py b/src/pipedream/deployed_triggers/raw_client.py index a5c37f2..9f4e96d 100644 --- a/src/pipedream/deployed_triggers/raw_client.py +++ b/src/pipedream/deployed_triggers/raw_client.py @@ -28,7 +28,6 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def list( self, - project_id: str, *, external_user_id: str, after: typing.Optional[str] = None, @@ -39,9 +38,6 @@ def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - external_user_id : str Your end user ID, for whom you deployed the trigger @@ -63,7 +59,7 @@ def list( deployed triggers listed """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers", method="GET", params={ "after": after, @@ -89,7 +85,6 @@ 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( - project_id, external_user_id=external_user_id, after=_parsed_next, before=before, @@ -105,19 +100,11 @@ def list( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def retrieve( - self, - project_id: str, - trigger_id: str, - *, - external_user_id: str, - request_options: typing.Optional[RequestOptions] = None, + self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DeployedComponent]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -132,7 +119,7 @@ def retrieve( deployed trigger retrieved """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}", method="GET", params={ "external_user_id": external_user_id, @@ -157,7 +144,6 @@ def retrieve( def update( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -169,9 +155,6 @@ def update( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -195,7 +178,7 @@ def update( deployed trigger updated """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}", method="PUT", params={ "external_user_id": external_user_id, @@ -229,7 +212,6 @@ def update( def delete( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -239,9 +221,6 @@ def delete( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -258,7 +237,7 @@ def delete( HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}", method="DELETE", params={ "external_user_id": external_user_id, @@ -276,7 +255,6 @@ def delete( def list_events( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -286,9 +264,6 @@ def list_events( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -306,7 +281,7 @@ def list_events( trigger events retrieved """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/events", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/events", method="GET", params={ "external_user_id": external_user_id, @@ -331,19 +306,11 @@ def list_events( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def list_workflows( - self, - project_id: str, - trigger_id: str, - *, - external_user_id: str, - request_options: typing.Optional[RequestOptions] = None, + self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetTriggerWorkflowsResponse]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -358,7 +325,7 @@ def list_workflows( trigger workflows retrieved """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/pipelines", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/pipelines", method="GET", params={ "external_user_id": external_user_id, @@ -382,7 +349,6 @@ def list_workflows( def update_workflows( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -392,9 +358,6 @@ def update_workflows( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -412,7 +375,7 @@ def update_workflows( trigger workflows updated """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/pipelines", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/pipelines", method="PUT", params={ "external_user_id": external_user_id, @@ -442,19 +405,11 @@ def update_workflows( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def list_webhooks( - self, - project_id: str, - trigger_id: str, - *, - external_user_id: str, - request_options: typing.Optional[RequestOptions] = None, + self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetTriggerWebhooksResponse]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -469,7 +424,7 @@ def list_webhooks( trigger webhooks retrieved """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/webhooks", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/webhooks", method="GET", params={ "external_user_id": external_user_id, @@ -493,7 +448,6 @@ def list_webhooks( def update_webhooks( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -503,9 +457,6 @@ def update_webhooks( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -523,7 +474,7 @@ def update_webhooks( trigger webhooks updated """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/webhooks", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/webhooks", method="PUT", params={ "external_user_id": external_user_id, @@ -559,7 +510,6 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def list( self, - project_id: str, *, external_user_id: str, after: typing.Optional[str] = None, @@ -570,9 +520,6 @@ async def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - external_user_id : str Your end user ID, for whom you deployed the trigger @@ -594,7 +541,7 @@ async def list( deployed triggers listed """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers", method="GET", params={ "after": after, @@ -622,7 +569,6 @@ async def list( async def _get_next(): return await self.list( - project_id, external_user_id=external_user_id, after=_parsed_next, before=before, @@ -639,19 +585,11 @@ async def _get_next(): raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def retrieve( - self, - project_id: str, - trigger_id: str, - *, - external_user_id: str, - request_options: typing.Optional[RequestOptions] = None, + self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DeployedComponent]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -666,7 +604,7 @@ async def retrieve( deployed trigger retrieved """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}", method="GET", params={ "external_user_id": external_user_id, @@ -691,7 +629,6 @@ async def retrieve( async def update( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -703,9 +640,6 @@ async def update( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -729,7 +663,7 @@ async def update( deployed trigger updated """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}", method="PUT", params={ "external_user_id": external_user_id, @@ -763,7 +697,6 @@ async def update( async def delete( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -773,9 +706,6 @@ async def delete( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -792,7 +722,7 @@ async def delete( AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}", method="DELETE", params={ "external_user_id": external_user_id, @@ -810,7 +740,6 @@ async def delete( async def list_events( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -820,9 +749,6 @@ async def list_events( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -840,7 +766,7 @@ async def list_events( trigger events retrieved """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/events", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/events", method="GET", params={ "external_user_id": external_user_id, @@ -865,19 +791,11 @@ async def list_events( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def list_workflows( - self, - project_id: str, - trigger_id: str, - *, - external_user_id: str, - request_options: typing.Optional[RequestOptions] = None, + self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetTriggerWorkflowsResponse]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -892,7 +810,7 @@ async def list_workflows( trigger workflows retrieved """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/pipelines", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/pipelines", method="GET", params={ "external_user_id": external_user_id, @@ -916,7 +834,6 @@ async def list_workflows( async def update_workflows( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -926,9 +843,6 @@ async def update_workflows( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -946,7 +860,7 @@ async def update_workflows( trigger workflows updated """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/pipelines", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/pipelines", method="PUT", params={ "external_user_id": external_user_id, @@ -976,19 +890,11 @@ async def update_workflows( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def list_webhooks( - self, - project_id: str, - trigger_id: str, - *, - external_user_id: str, - request_options: typing.Optional[RequestOptions] = None, + self, trigger_id: str, *, external_user_id: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetTriggerWebhooksResponse]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -1003,7 +909,7 @@ async def list_webhooks( trigger webhooks retrieved """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/webhooks", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/webhooks", method="GET", params={ "external_user_id": external_user_id, @@ -1027,7 +933,6 @@ async def list_webhooks( async def update_webhooks( self, - project_id: str, trigger_id: str, *, external_user_id: str, @@ -1037,9 +942,6 @@ async def update_webhooks( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - trigger_id : str external_user_id : str @@ -1057,7 +959,7 @@ async def update_webhooks( trigger webhooks updated """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/webhooks", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/deployed-triggers/{jsonable_encoder(trigger_id)}/webhooks", method="PUT", params={ "external_user_id": external_user_id, diff --git a/src/pipedream/oauth_tokens/client.py b/src/pipedream/oauth_tokens/client.py index 8342b20..bd891f1 100644 --- a/src/pipedream/oauth_tokens/client.py +++ b/src/pipedream/oauth_tokens/client.py @@ -49,6 +49,7 @@ def create( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -104,6 +105,7 @@ async def create( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", diff --git a/src/pipedream/projects/client.py b/src/pipedream/projects/client.py index 510cfa6..cb6cf35 100644 --- a/src/pipedream/projects/client.py +++ b/src/pipedream/projects/client.py @@ -23,15 +23,10 @@ def with_raw_response(self) -> RawProjectsClient: """ return self._raw_client - def retrieve_info( - self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> ProjectInfoResponse: + def retrieve_info(self, *, request_options: typing.Optional[RequestOptions] = None) -> ProjectInfoResponse: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -45,15 +40,14 @@ def retrieve_info( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) - client.projects.retrieve_info( - project_id="project_id", - ) + client.projects.retrieve_info() """ - _response = self._raw_client.retrieve_info(project_id, request_options=request_options) + _response = self._raw_client.retrieve_info(request_options=request_options) return _response.data @@ -72,15 +66,10 @@ def with_raw_response(self) -> AsyncRawProjectsClient: """ return self._raw_client - async def retrieve_info( - self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> ProjectInfoResponse: + async def retrieve_info(self, *, request_options: typing.Optional[RequestOptions] = None) -> ProjectInfoResponse: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -96,6 +85,7 @@ async def retrieve_info( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -103,12 +93,10 @@ async def retrieve_info( async def main() -> None: - await client.projects.retrieve_info( - project_id="project_id", - ) + await client.projects.retrieve_info() asyncio.run(main()) """ - _response = await self._raw_client.retrieve_info(project_id, request_options=request_options) + _response = await self._raw_client.retrieve_info(request_options=request_options) return _response.data diff --git a/src/pipedream/projects/raw_client.py b/src/pipedream/projects/raw_client.py index c4e468b..8d251b2 100644 --- a/src/pipedream/projects/raw_client.py +++ b/src/pipedream/projects/raw_client.py @@ -17,14 +17,11 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def retrieve_info( - self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ProjectInfoResponse]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -34,7 +31,7 @@ def retrieve_info( project info retrieved """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/projects/info", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/projects/info", method="GET", request_options=request_options, ) @@ -59,14 +56,11 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def retrieve_info( - self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ProjectInfoResponse]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -76,7 +70,7 @@ async def retrieve_info( project info retrieved """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/projects/info", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/projects/info", method="GET", request_options=request_options, ) diff --git a/src/pipedream/proxy/client.py b/src/pipedream/proxy/client.py index 0050c22..7eca883 100644 --- a/src/pipedream/proxy/client.py +++ b/src/pipedream/proxy/client.py @@ -27,7 +27,6 @@ def with_raw_response(self) -> RawProxyClient: def get( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -37,9 +36,6 @@ def get( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -62,29 +58,24 @@ def get( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.proxy.get( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", ) """ _response = self._raw_client.get( - project_id, - url_64, - external_user_id=external_user_id, - account_id=account_id, - request_options=request_options, + url_64, external_user_id=external_user_id, account_id=account_id, request_options=request_options ) return _response.data def post( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -95,9 +86,6 @@ def post( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -122,12 +110,12 @@ def post( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.proxy.post( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", @@ -135,7 +123,6 @@ def post( ) """ _response = self._raw_client.post( - project_id, url_64, external_user_id=external_user_id, account_id=account_id, @@ -146,7 +133,6 @@ def post( def put( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -157,9 +143,6 @@ def put( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -184,12 +167,12 @@ def put( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.proxy.put( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", @@ -197,7 +180,6 @@ def put( ) """ _response = self._raw_client.put( - project_id, url_64, external_user_id=external_user_id, account_id=account_id, @@ -208,7 +190,6 @@ def put( def delete( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -218,9 +199,6 @@ def delete( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -243,29 +221,24 @@ def delete( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.proxy.delete( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", ) """ _response = self._raw_client.delete( - project_id, - url_64, - external_user_id=external_user_id, - account_id=account_id, - request_options=request_options, + url_64, external_user_id=external_user_id, account_id=account_id, request_options=request_options ) return _response.data def patch( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -276,9 +249,6 @@ def patch( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -303,12 +273,12 @@ def patch( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.proxy.patch( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", @@ -316,7 +286,6 @@ def patch( ) """ _response = self._raw_client.patch( - project_id, url_64, external_user_id=external_user_id, account_id=account_id, @@ -343,7 +312,6 @@ def with_raw_response(self) -> AsyncRawProxyClient: async def get( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -353,9 +321,6 @@ async def get( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -380,6 +345,7 @@ async def get( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -388,7 +354,6 @@ async def get( async def main() -> None: await client.proxy.get( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", @@ -398,17 +363,12 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.get( - project_id, - url_64, - external_user_id=external_user_id, - account_id=account_id, - request_options=request_options, + url_64, external_user_id=external_user_id, account_id=account_id, request_options=request_options ) return _response.data async def post( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -419,9 +379,6 @@ async def post( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -448,6 +405,7 @@ async def post( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -456,7 +414,6 @@ async def post( async def main() -> None: await client.proxy.post( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", @@ -467,7 +424,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.post( - project_id, url_64, external_user_id=external_user_id, account_id=account_id, @@ -478,7 +434,6 @@ async def main() -> None: async def put( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -489,9 +444,6 @@ async def put( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -518,6 +470,7 @@ async def put( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -526,7 +479,6 @@ async def put( async def main() -> None: await client.proxy.put( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", @@ -537,7 +489,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.put( - project_id, url_64, external_user_id=external_user_id, account_id=account_id, @@ -548,7 +499,6 @@ async def main() -> None: async def delete( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -558,9 +508,6 @@ async def delete( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -585,6 +532,7 @@ async def delete( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -593,7 +541,6 @@ async def delete( async def main() -> None: await client.proxy.delete( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", @@ -603,17 +550,12 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.delete( - project_id, - url_64, - external_user_id=external_user_id, - account_id=account_id, - request_options=request_options, + url_64, external_user_id=external_user_id, account_id=account_id, request_options=request_options ) return _response.data async def patch( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -624,9 +566,6 @@ async def patch( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -653,6 +592,7 @@ async def patch( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -661,7 +601,6 @@ async def patch( async def main() -> None: await client.proxy.patch( - project_id="project_id", url_64="url_64", external_user_id="external_user_id", account_id="account_id", @@ -672,7 +611,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.patch( - project_id, url_64, external_user_id=external_user_id, account_id=account_id, diff --git a/src/pipedream/proxy/raw_client.py b/src/pipedream/proxy/raw_client.py index f82002a..a935549 100644 --- a/src/pipedream/proxy/raw_client.py +++ b/src/pipedream/proxy/raw_client.py @@ -20,7 +20,6 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def get( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -30,9 +29,6 @@ def get( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -51,7 +47,7 @@ def get( proxy request successful """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/proxy/{jsonable_encoder(url_64)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/proxy/{jsonable_encoder(url_64)}", method="GET", params={ "external_user_id": external_user_id, @@ -76,7 +72,6 @@ def get( def post( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -87,9 +82,6 @@ def post( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -110,7 +102,7 @@ def post( proxy request successful """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/proxy/{jsonable_encoder(url_64)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/proxy/{jsonable_encoder(url_64)}", method="POST", params={ "external_user_id": external_user_id, @@ -140,7 +132,6 @@ def post( def put( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -151,9 +142,6 @@ def put( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -174,7 +162,7 @@ def put( proxy request successful """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/proxy/{jsonable_encoder(url_64)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/proxy/{jsonable_encoder(url_64)}", method="PUT", params={ "external_user_id": external_user_id, @@ -204,7 +192,6 @@ def put( def delete( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -214,9 +201,6 @@ def delete( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -235,7 +219,7 @@ def delete( proxy request successful """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/proxy/{jsonable_encoder(url_64)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/proxy/{jsonable_encoder(url_64)}", method="DELETE", params={ "external_user_id": external_user_id, @@ -260,7 +244,6 @@ def delete( def patch( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -271,9 +254,6 @@ def patch( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -294,7 +274,7 @@ def patch( proxy request successful """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/proxy/{jsonable_encoder(url_64)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/proxy/{jsonable_encoder(url_64)}", method="PATCH", params={ "external_user_id": external_user_id, @@ -329,7 +309,6 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def get( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -339,9 +318,6 @@ async def get( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -360,7 +336,7 @@ async def get( proxy request successful """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/proxy/{jsonable_encoder(url_64)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/proxy/{jsonable_encoder(url_64)}", method="GET", params={ "external_user_id": external_user_id, @@ -385,7 +361,6 @@ async def get( async def post( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -396,9 +371,6 @@ async def post( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -419,7 +391,7 @@ async def post( proxy request successful """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/proxy/{jsonable_encoder(url_64)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/proxy/{jsonable_encoder(url_64)}", method="POST", params={ "external_user_id": external_user_id, @@ -449,7 +421,6 @@ async def post( async def put( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -460,9 +431,6 @@ async def put( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -483,7 +451,7 @@ async def put( proxy request successful """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/proxy/{jsonable_encoder(url_64)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/proxy/{jsonable_encoder(url_64)}", method="PUT", params={ "external_user_id": external_user_id, @@ -513,7 +481,6 @@ async def put( async def delete( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -523,9 +490,6 @@ async def delete( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -544,7 +508,7 @@ async def delete( proxy request successful """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/proxy/{jsonable_encoder(url_64)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/proxy/{jsonable_encoder(url_64)}", method="DELETE", params={ "external_user_id": external_user_id, @@ -569,7 +533,6 @@ async def delete( async def patch( self, - project_id: str, url_64: str, *, external_user_id: str, @@ -580,9 +543,6 @@ async def patch( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - url_64 : str Base64-encoded target URL @@ -603,7 +563,7 @@ async def patch( proxy request successful """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/proxy/{jsonable_encoder(url_64)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/proxy/{jsonable_encoder(url_64)}", method="PATCH", params={ "external_user_id": external_user_id, diff --git a/src/pipedream/tokens/client.py b/src/pipedream/tokens/client.py index badcc92..2477a45 100644 --- a/src/pipedream/tokens/client.py +++ b/src/pipedream/tokens/client.py @@ -73,6 +73,7 @@ def create( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -120,6 +121,7 @@ def validate( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -194,6 +196,7 @@ async def create( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -249,6 +252,7 @@ async def validate( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", diff --git a/src/pipedream/triggers/client.py b/src/pipedream/triggers/client.py index 9b9d5b4..025ca01 100644 --- a/src/pipedream/triggers/client.py +++ b/src/pipedream/triggers/client.py @@ -32,7 +32,6 @@ def with_raw_response(self) -> RawTriggersClient: def list( self, - project_id: str, *, after: typing.Optional[str] = None, before: typing.Optional[str] = None, @@ -44,9 +43,6 @@ def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - after : typing.Optional[str] The cursor to start from for pagination @@ -75,13 +71,12 @@ def list( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) - response = client.triggers.list( - project_id="project_id", - ) + response = client.triggers.list() for item in response: yield item # alternatively, you can paginate page-by-page @@ -89,18 +84,13 @@ def list( yield page """ return self._raw_client.list( - project_id, after=after, before=before, limit=limit, q=q, app=app, request_options=request_options + after=after, before=before, limit=limit, q=q, app=app, request_options=request_options ) - def retrieve( - self, project_id: str, component_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> Component: + def retrieve(self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Component: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') @@ -117,21 +107,20 @@ def retrieve( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.triggers.retrieve( - project_id="project_id", component_id="component_id", ) """ - _response = self._raw_client.retrieve(project_id, component_id, request_options=request_options) + _response = self._raw_client.retrieve(component_id, request_options=request_options) return _response.data def configure_prop( self, - project_id: str, *, id: str, external_user_id: str, @@ -149,9 +138,6 @@ def configure_prop( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -197,19 +183,18 @@ def configure_prop( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.triggers.configure_prop( - project_id="project_id", id="id", external_user_id="external_user_id", prop_name="prop_name", ) """ _response = self._raw_client.configure_prop( - project_id, id=id, external_user_id=external_user_id, prop_name=prop_name, @@ -227,7 +212,6 @@ def configure_prop( def reload_props( self, - project_id: str, *, id: str, external_user_id: str, @@ -241,9 +225,6 @@ def reload_props( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -277,18 +258,17 @@ def reload_props( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.triggers.reload_props( - project_id="project_id", id="id", external_user_id="external_user_id", ) """ _response = self._raw_client.reload_props( - project_id, id=id, external_user_id=external_user_id, async_handle=async_handle, @@ -302,7 +282,6 @@ def reload_props( def deploy( self, - project_id: str, *, id: str, external_user_id: str, @@ -314,9 +293,6 @@ def deploy( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The trigger component ID @@ -345,18 +321,17 @@ def deploy( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.triggers.deploy( - project_id="project_id", id="id", external_user_id="external_user_id", ) """ _response = self._raw_client.deploy( - project_id, id=id, external_user_id=external_user_id, configured_props=configured_props, @@ -384,7 +359,6 @@ def with_raw_response(self) -> AsyncRawTriggersClient: async def list( self, - project_id: str, *, after: typing.Optional[str] = None, before: typing.Optional[str] = None, @@ -396,9 +370,6 @@ async def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - after : typing.Optional[str] The cursor to start from for pagination @@ -429,6 +400,7 @@ async def list( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -436,9 +408,7 @@ async def list( async def main() -> None: - response = await client.triggers.list( - project_id="project_id", - ) + response = await client.triggers.list() async for item in response: yield item @@ -450,18 +420,15 @@ async def main() -> None: asyncio.run(main()) """ return await self._raw_client.list( - project_id, after=after, before=before, limit=limit, q=q, app=app, request_options=request_options + after=after, before=before, limit=limit, q=q, app=app, request_options=request_options ) async def retrieve( - self, project_id: str, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> Component: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') @@ -480,6 +447,7 @@ async def retrieve( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -488,19 +456,17 @@ async def retrieve( async def main() -> None: await client.triggers.retrieve( - project_id="project_id", component_id="component_id", ) asyncio.run(main()) """ - _response = await self._raw_client.retrieve(project_id, component_id, request_options=request_options) + _response = await self._raw_client.retrieve(component_id, request_options=request_options) return _response.data async def configure_prop( self, - project_id: str, *, id: str, external_user_id: str, @@ -518,9 +484,6 @@ async def configure_prop( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -568,6 +531,7 @@ async def configure_prop( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -576,7 +540,6 @@ async def configure_prop( async def main() -> None: await client.triggers.configure_prop( - project_id="project_id", id="id", external_user_id="external_user_id", prop_name="prop_name", @@ -586,7 +549,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.configure_prop( - project_id, id=id, external_user_id=external_user_id, prop_name=prop_name, @@ -604,7 +566,6 @@ async def main() -> None: async def reload_props( self, - project_id: str, *, id: str, external_user_id: str, @@ -618,9 +579,6 @@ async def reload_props( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -656,6 +614,7 @@ async def reload_props( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -664,7 +623,6 @@ async def reload_props( async def main() -> None: await client.triggers.reload_props( - project_id="project_id", id="id", external_user_id="external_user_id", ) @@ -673,7 +631,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.reload_props( - project_id, id=id, external_user_id=external_user_id, async_handle=async_handle, @@ -687,7 +644,6 @@ async def main() -> None: async def deploy( self, - project_id: str, *, id: str, external_user_id: str, @@ -699,9 +655,6 @@ async def deploy( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The trigger component ID @@ -732,6 +685,7 @@ async def deploy( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -740,7 +694,6 @@ async def deploy( async def main() -> None: await client.triggers.deploy( - project_id="project_id", id="id", external_user_id="external_user_id", ) @@ -749,7 +702,6 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.deploy( - project_id, id=id, external_user_id=external_user_id, configured_props=configured_props, diff --git a/src/pipedream/triggers/raw_client.py b/src/pipedream/triggers/raw_client.py index 2e62b98..820aaf6 100644 --- a/src/pipedream/triggers/raw_client.py +++ b/src/pipedream/triggers/raw_client.py @@ -28,7 +28,6 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def list( self, - project_id: str, *, after: typing.Optional[str] = None, before: typing.Optional[str] = None, @@ -40,9 +39,6 @@ def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - after : typing.Optional[str] The cursor to start from for pagination @@ -67,7 +63,7 @@ def list( triggers listed """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/triggers", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/triggers", method="GET", params={ "after": after, @@ -94,7 +90,6 @@ 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( - project_id, after=_parsed_next, before=before, limit=limit, @@ -111,14 +106,11 @@ def list( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def retrieve( - self, project_id: str, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[Component]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') @@ -131,7 +123,7 @@ def retrieve( trigger retrieved """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/triggers/{jsonable_encoder(component_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/triggers/{jsonable_encoder(component_id)}", method="GET", request_options=request_options, ) @@ -153,7 +145,6 @@ def retrieve( def configure_prop( self, - project_id: str, *, id: str, external_user_id: str, @@ -171,9 +162,6 @@ def configure_prop( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -215,7 +203,7 @@ def configure_prop( trigger configuration started """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/triggers/configure", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/triggers/configure", method="POST", json={ "id": id, @@ -253,7 +241,6 @@ def configure_prop( def reload_props( self, - project_id: str, *, id: str, external_user_id: str, @@ -267,9 +254,6 @@ def reload_props( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -299,7 +283,7 @@ def reload_props( trigger props reloaded """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/triggers/props", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/triggers/props", method="POST", json={ "id": id, @@ -333,7 +317,6 @@ def reload_props( def deploy( self, - project_id: str, *, id: str, external_user_id: str, @@ -345,9 +328,6 @@ def deploy( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The trigger component ID @@ -372,7 +352,7 @@ def deploy( trigger deployed """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/triggers/deploy", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/triggers/deploy", method="POST", json={ "id": id, @@ -410,7 +390,6 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def list( self, - project_id: str, *, after: typing.Optional[str] = None, before: typing.Optional[str] = None, @@ -422,9 +401,6 @@ async def list( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - after : typing.Optional[str] The cursor to start from for pagination @@ -449,7 +425,7 @@ async def list( triggers listed """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/triggers", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/triggers", method="GET", params={ "after": after, @@ -478,7 +454,6 @@ async def list( async def _get_next(): return await self.list( - project_id, after=_parsed_next, before=before, limit=limit, @@ -496,14 +471,11 @@ async def _get_next(): raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def retrieve( - self, project_id: str, component_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, component_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[Component]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - component_id : str The key that uniquely identifies the component (e.g., 'slack-send-message') @@ -516,7 +488,7 @@ async def retrieve( trigger retrieved """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/triggers/{jsonable_encoder(component_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/triggers/{jsonable_encoder(component_id)}", method="GET", request_options=request_options, ) @@ -538,7 +510,6 @@ async def retrieve( async def configure_prop( self, - project_id: str, *, id: str, external_user_id: str, @@ -556,9 +527,6 @@ async def configure_prop( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -600,7 +568,7 @@ async def configure_prop( trigger configuration started """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/triggers/configure", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/triggers/configure", method="POST", json={ "id": id, @@ -638,7 +606,6 @@ async def configure_prop( async def reload_props( self, - project_id: str, *, id: str, external_user_id: str, @@ -652,9 +619,6 @@ async def reload_props( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The component ID @@ -684,7 +648,7 @@ async def reload_props( trigger props reloaded """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/triggers/props", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/triggers/props", method="POST", json={ "id": id, @@ -718,7 +682,6 @@ async def reload_props( async def deploy( self, - project_id: str, *, id: str, external_user_id: str, @@ -730,9 +693,6 @@ async def deploy( """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - id : str The trigger component ID @@ -757,7 +717,7 @@ async def deploy( trigger deployed """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/triggers/deploy", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/triggers/deploy", method="POST", json={ "id": id, diff --git a/src/pipedream/users/client.py b/src/pipedream/users/client.py index a7a8dc7..de3cb50 100644 --- a/src/pipedream/users/client.py +++ b/src/pipedream/users/client.py @@ -23,14 +23,11 @@ def with_raw_response(self) -> RawUsersClient: return self._raw_client def delete_external_user( - self, project_id: str, external_user_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, external_user_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> None: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - external_user_id : str request_options : typing.Optional[RequestOptions] @@ -45,16 +42,16 @@ def delete_external_user( from pipedream import Pipedream client = Pipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.users.delete_external_user( - project_id="project_id", external_user_id="external_user_id", ) """ - _response = self._raw_client.delete_external_user(project_id, external_user_id, request_options=request_options) + _response = self._raw_client.delete_external_user(external_user_id, request_options=request_options) return _response.data @@ -74,14 +71,11 @@ def with_raw_response(self) -> AsyncRawUsersClient: return self._raw_client async def delete_external_user( - self, project_id: str, external_user_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, external_user_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> None: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - external_user_id : str request_options : typing.Optional[RequestOptions] @@ -98,6 +92,7 @@ async def delete_external_user( from pipedream import AsyncPipedream client = AsyncPipedream( + project_id="YOUR_PROJECT_ID", x_pd_environment="YOUR_X_PD_ENVIRONMENT", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", @@ -106,14 +101,11 @@ async def delete_external_user( async def main() -> None: await client.users.delete_external_user( - project_id="project_id", external_user_id="external_user_id", ) asyncio.run(main()) """ - _response = await self._raw_client.delete_external_user( - project_id, external_user_id, request_options=request_options - ) + _response = await self._raw_client.delete_external_user(external_user_id, request_options=request_options) return _response.data diff --git a/src/pipedream/users/raw_client.py b/src/pipedream/users/raw_client.py index fbe5e52..fa715eb 100644 --- a/src/pipedream/users/raw_client.py +++ b/src/pipedream/users/raw_client.py @@ -15,14 +15,11 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def delete_external_user( - self, project_id: str, external_user_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, external_user_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[None]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - external_user_id : str request_options : typing.Optional[RequestOptions] @@ -33,7 +30,7 @@ def delete_external_user( HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/users/{jsonable_encoder(external_user_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/users/{jsonable_encoder(external_user_id)}", method="DELETE", request_options=request_options, ) @@ -51,14 +48,11 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def delete_external_user( - self, project_id: str, external_user_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, external_user_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ Parameters ---------- - project_id : str - The project ID, which starts with 'proj_'. - external_user_id : str request_options : typing.Optional[RequestOptions] @@ -69,7 +63,7 @@ async def delete_external_user( AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( - f"v1/connect/{jsonable_encoder(project_id)}/users/{jsonable_encoder(external_user_id)}", + f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/users/{jsonable_encoder(external_user_id)}", method="DELETE", request_options=request_options, )