Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ client.actions.run(

## Async Client

The SDK also exports an `async` client so that you can make non-blocking calls to our API.
The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).

```python
import asyncio
Expand Down Expand Up @@ -89,7 +89,14 @@ client = Pipedream(
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
response = client.apps.list()
response = client.apps.list(
after="after",
before="before",
limit=1,
q="q",
sort_key="name",
sort_direction="asc",
)
for item in response:
yield item
# alternatively, you can paginate page-by-page
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "pipedream"

[tool.poetry]
name = "pipedream"
version = "1.0.8"
version = "1.0.9"
description = ""
readme = "README.md"
authors = []
Expand Down
56 changes: 34 additions & 22 deletions src/pipedream/accounts/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def with_raw_response(self) -> RawAccountsClient:
def list(
self,
*,
app_id: typing.Optional[str] = None,
external_user_id: typing.Optional[str] = None,
oauth_app_id: typing.Optional[str] = None,
after: typing.Optional[str] = None,
before: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
app: typing.Optional[str] = None,
include_credentials: typing.Optional[bool] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> SyncPager[Account]:
Expand All @@ -44,9 +44,6 @@ def list(

Parameters
----------
app_id : typing.Optional[str]
The app slug or ID to filter accounts by.

external_user_id : typing.Optional[str]

oauth_app_id : typing.Optional[str]
Expand All @@ -61,6 +58,9 @@ def list(
limit : typing.Optional[int]
The maximum number of results to return

app : typing.Optional[str]
The app slug or ID to filter accounts by.

include_credentials : typing.Optional[bool]
Whether to retrieve the account's credentials or not

Expand All @@ -82,20 +82,28 @@ def list(
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
response = client.accounts.list()
response = client.accounts.list(
external_user_id="external_user_id",
oauth_app_id="oauth_app_id",
after="after",
before="before",
limit=1,
app="app",
include_credentials=True,
)
for item in response:
yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
yield page
"""
return self._raw_client.list(
app_id=app_id,
external_user_id=external_user_id,
oauth_app_id=oauth_app_id,
after=after,
before=before,
limit=limit,
app=app,
include_credentials=include_credentials,
request_options=request_options,
)
Expand All @@ -106,7 +114,6 @@ def create(
app_slug: str,
cfmap_json: str,
connect_token: str,
app_id: typing.Optional[str] = None,
external_user_id: typing.Optional[str] = None,
oauth_app_id: typing.Optional[str] = None,
name: typing.Optional[str] = OMIT,
Expand All @@ -126,9 +133,6 @@ def create(
connect_token : str
The connect token for authentication

app_id : typing.Optional[str]
The app slug or ID to filter accounts by.

external_user_id : typing.Optional[str]

oauth_app_id : typing.Optional[str]
Expand Down Expand Up @@ -156,6 +160,8 @@ def create(
client_secret="YOUR_CLIENT_SECRET",
)
client.accounts.create(
external_user_id="external_user_id",
oauth_app_id="oauth_app_id",
app_slug="app_slug",
cfmap_json="cfmap_json",
connect_token="connect_token",
Expand All @@ -165,7 +171,6 @@ def create(
app_slug=app_slug,
cfmap_json=cfmap_json,
connect_token=connect_token,
app_id=app_id,
external_user_id=external_user_id,
oauth_app_id=oauth_app_id,
name=name,
Expand Down Expand Up @@ -210,6 +215,7 @@ def retrieve(
)
client.accounts.retrieve(
account_id="account_id",
include_credentials=True,
)
"""
_response = self._raw_client.retrieve(
Expand Down Expand Up @@ -300,12 +306,12 @@ def with_raw_response(self) -> AsyncRawAccountsClient:
async def list(
self,
*,
app_id: typing.Optional[str] = None,
external_user_id: typing.Optional[str] = None,
oauth_app_id: typing.Optional[str] = None,
after: typing.Optional[str] = None,
before: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
app: typing.Optional[str] = None,
include_credentials: typing.Optional[bool] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncPager[Account]:
Expand All @@ -314,9 +320,6 @@ async def list(

Parameters
----------
app_id : typing.Optional[str]
The app slug or ID to filter accounts by.

external_user_id : typing.Optional[str]

oauth_app_id : typing.Optional[str]
Expand All @@ -331,6 +334,9 @@ async def list(
limit : typing.Optional[int]
The maximum number of results to return

app : typing.Optional[str]
The app slug or ID to filter accounts by.

include_credentials : typing.Optional[bool]
Whether to retrieve the account's credentials or not

Expand All @@ -357,7 +363,15 @@ async def list(


async def main() -> None:
response = await client.accounts.list()
response = await client.accounts.list(
external_user_id="external_user_id",
oauth_app_id="oauth_app_id",
after="after",
before="before",
limit=1,
app="app",
include_credentials=True,
)
async for item in response:
yield item

Expand All @@ -369,12 +383,12 @@ async def main() -> None:
asyncio.run(main())
"""
return await self._raw_client.list(
app_id=app_id,
external_user_id=external_user_id,
oauth_app_id=oauth_app_id,
after=after,
before=before,
limit=limit,
app=app,
include_credentials=include_credentials,
request_options=request_options,
)
Expand All @@ -385,7 +399,6 @@ async def create(
app_slug: str,
cfmap_json: str,
connect_token: str,
app_id: typing.Optional[str] = None,
external_user_id: typing.Optional[str] = None,
oauth_app_id: typing.Optional[str] = None,
name: typing.Optional[str] = OMIT,
Expand All @@ -405,9 +418,6 @@ async def create(
connect_token : str
The connect token for authentication

app_id : typing.Optional[str]
The app slug or ID to filter accounts by.

external_user_id : typing.Optional[str]

oauth_app_id : typing.Optional[str]
Expand Down Expand Up @@ -440,6 +450,8 @@ async def create(

async def main() -> None:
await client.accounts.create(
external_user_id="external_user_id",
oauth_app_id="oauth_app_id",
app_slug="app_slug",
cfmap_json="cfmap_json",
connect_token="connect_token",
Expand All @@ -452,7 +464,6 @@ async def main() -> None:
app_slug=app_slug,
cfmap_json=cfmap_json,
connect_token=connect_token,
app_id=app_id,
external_user_id=external_user_id,
oauth_app_id=oauth_app_id,
name=name,
Expand Down Expand Up @@ -502,6 +513,7 @@ async def retrieve(
async def main() -> None:
await client.accounts.retrieve(
account_id="account_id",
include_credentials=True,
)


Expand Down
Loading
Loading