Thanks to visit codestin.com
Credit goes to github.com

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
13 changes: 13 additions & 0 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"cliVersion": "1.0.4",
"generatorName": "fernapi/fern-python-sdk",
"generatorVersion": "4.36.2",
"generatorConfig": {
"client": {
"class_name": "Client",
"filename": "client.py",
"exported_class_name": "Pipedream",
"exported_filename": "pipedream.py"
}
}
}
37 changes: 27 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@

The Pipedream Python library provides convenient access to the Pipedream APIs from Python.

## Table of Contents

- [Installation](#installation)
- [Reference](#reference)
- [Usage](#usage)
- [Async Client](#async-client)
- [Exception Handling](#exception-handling)
- [Pagination](#pagination)
- [Advanced](#advanced)
- [Access Raw Response Data](#access-raw-response-data)
- [Retries](#retries)
- [Timeouts](#timeouts)
- [Custom Client](#custom-client)
- [Contributing](#contributing)

## Installation

```sh
Expand Down Expand Up @@ -89,21 +104,23 @@ client = Pipedream(
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
response = client.apps.list(
after="after",
before="before",
limit=1,
q="q",
sort_key="name",
sort_direction="asc",
)
response = client.apps.list()
for item in response:
yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
yield page
```

```python
# You can also iterate through pages and access the typed response per page
pager = client.apps.list(...)
for page in pager.iter_pages():
print(page.response) # access the typed response for each page
for item in page:
print(item)
```

## Advanced

### Access Raw Response Data
Expand All @@ -121,11 +138,11 @@ response = client.actions.with_raw_response.run(...)
print(response.headers) # access the response headers
print(response.data) # access the underlying object
pager = client.apps.list(...)
print(pager.response.headers) # access the response headers for the first page
print(pager.response) # access the typed response for the first page
for item in pager:
print(item) # access the underlying object(s)
for page in pager.iter_pages():
print(page.response.headers) # access the response headers for each page
print(page.response) # access the typed response for each page
for item in page:
print(item) # access the underlying object(s)
```
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions 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.11"
version = "1.0.12"
description = ""
readme = "README.md"
authors = []
Expand All @@ -30,7 +30,7 @@ packages = [
{ include = "pipedream", from = "src"}
]

[project.urls]
[tool.poetry.urls]
Repository = 'https://github.com/PipedreamHQ/pipedream-sdk-python'

[tool.poetry.dependencies]
Expand Down
35 changes: 7 additions & 28 deletions src/pipedream/accounts/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from ..core.pagination import AsyncPager, SyncPager
from ..core.request_options import RequestOptions
from ..types.account import Account
from ..types.list_accounts_response import ListAccountsResponse
from .raw_client import AsyncRawAccountsClient, RawAccountsClient

# this is used as the default value for optional parameters
Expand Down Expand Up @@ -38,7 +39,7 @@ def list(
app: typing.Optional[str] = None,
include_credentials: typing.Optional[bool] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> SyncPager[Account]:
) -> SyncPager[Account, ListAccountsResponse]:
"""
Retrieve all connected accounts for the project with optional filtering

Expand Down Expand Up @@ -69,7 +70,7 @@ def list(

Returns
-------
SyncPager[Account]
SyncPager[Account, ListAccountsResponse]
accounts listed

Examples
Expand All @@ -82,15 +83,7 @@ def list(
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
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,
)
response = client.accounts.list()
for item in response:
yield item
# alternatively, you can paginate page-by-page
Expand Down Expand Up @@ -160,8 +153,6 @@ 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 Down Expand Up @@ -215,7 +206,6 @@ def retrieve(
)
client.accounts.retrieve(
account_id="account_id",
include_credentials=True,
)
"""
_response = self._raw_client.retrieve(
Expand Down Expand Up @@ -314,7 +304,7 @@ async def list(
app: typing.Optional[str] = None,
include_credentials: typing.Optional[bool] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncPager[Account]:
) -> AsyncPager[Account, ListAccountsResponse]:
"""
Retrieve all connected accounts for the project with optional filtering

Expand Down Expand Up @@ -345,7 +335,7 @@ async def list(

Returns
-------
AsyncPager[Account]
AsyncPager[Account, ListAccountsResponse]
accounts listed

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


async def main() -> None:
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,
)
response = await client.accounts.list()
async for item in response:
yield item

Expand Down Expand Up @@ -450,8 +432,6 @@ 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 Down Expand Up @@ -513,7 +493,6 @@ async def retrieve(
async def main() -> None:
await client.accounts.retrieve(
account_id="account_id",
include_credentials=True,
)


Expand Down
Loading
Loading