Skip to content

Commit c3821ee

Browse files
SDK regeneration
1 parent 4689a96 commit c3821ee

File tree

82 files changed

+3552
-1762
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+3552
-1762
lines changed

.fern/metadata.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"cliVersion": "3.5.0",
3+
"generatorName": "fernapi/fern-python-sdk",
4+
"generatorVersion": "4.45.0",
5+
"generatorConfig": {
6+
"client": {
7+
"class_name": "Client",
8+
"filename": "client.py",
9+
"exported_class_name": "Pipedream",
10+
"exported_filename": "pipedream.py"
11+
}
12+
}
13+
}

README.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The Pipedream Python library provides convenient access to the Pipedream APIs fr
1313
- [Async Client](#async-client)
1414
- [Exception Handling](#exception-handling)
1515
- [Pagination](#pagination)
16+
- [Oauth Token Override](#oauth-token-override)
1617
- [Advanced](#advanced)
1718
- [Access Raw Response Data](#access-raw-response-data)
1819
- [Retries](#retries)
@@ -104,14 +105,48 @@ client = Pipedream(
104105
client_id="YOUR_CLIENT_ID",
105106
client_secret="YOUR_CLIENT_SECRET",
106107
)
107-
response = client.apps.list()
108+
response = client.apps.list(
109+
after="after",
110+
before="before",
111+
limit=1,
112+
q="q",
113+
sort_key="name",
114+
sort_direction="asc",
115+
)
108116
for item in response:
109117
yield item
110118
# alternatively, you can paginate page-by-page
111119
for page in response.iter_pages():
112120
yield page
113121
```
114122

123+
```python
124+
# You can also iterate through pages and access the typed response per page
125+
pager = client.apps.list(...)
126+
for page in pager.iter_pages():
127+
print(page.response) # access the typed response for each page
128+
for item in page:
129+
print(item)
130+
```
131+
132+
## Oauth Token Override
133+
134+
This SDK supports two authentication methods: OAuth client credentials flow (automatic token management) or direct bearer token authentication. You can choose between these options when initializing the client:
135+
136+
```python
137+
from pipedream import Pipedream
138+
139+
# Option 1: Direct bearer token (bypass OAuth flow)
140+
client = Pipedream(..., token="my-pre-generated-bearer-token")
141+
142+
from pipedream import Pipedream
143+
144+
# Option 2: OAuth client credentials flow (automatic token management)
145+
client = Pipedream(
146+
..., client_id="your-client-id", client_secret="your-client-secret"
147+
)
148+
```
149+
115150
## Advanced
116151

117152
### Access Raw Response Data
@@ -129,11 +164,11 @@ response = client.actions.with_raw_response.run(...)
129164
print(response.headers) # access the response headers
130165
print(response.data) # access the underlying object
131166
pager = client.apps.list(...)
132-
print(pager.response.headers) # access the response headers for the first page
167+
print(pager.response) # access the typed response for the first page
133168
for item in pager:
134169
print(item) # access the underlying object(s)
135170
for page in pager.iter_pages():
136-
print(page.response.headers) # access the response headers for each page
171+
print(page.response) # access the typed response for each page
137172
for item in page:
138173
print(item) # access the underlying object(s)
139174
```

poetry.lock

Lines changed: 35 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[project]
22
name = "pipedream"
3+
dynamic = ["version"]
34

45
[tool.poetry]
56
name = "pipedream"
6-
version = "1.0.12"
7+
version = "1.0.13"
78
description = ""
89
readme = "README.md"
910
authors = []
@@ -30,7 +31,7 @@ packages = [
3031
{ include = "pipedream", from = "src"}
3132
]
3233

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

3637
[tool.poetry.dependencies]
@@ -44,6 +45,7 @@ typing_extensions = ">= 4.0.0"
4445
mypy = "==1.13.0"
4546
pytest = "^7.4.0"
4647
pytest-asyncio = "^0.23.5"
48+
pytest-xdist = "^3.6.1"
4749
python-dateutil = "^2.9.0"
4850
types-python-dateutil = "^2.9.0.20240316"
4951
ruff = "==0.11.5"

src/pipedream/accounts/client.py

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from ..core.pagination import AsyncPager, SyncPager
77
from ..core.request_options import RequestOptions
88
from ..types.account import Account
9+
from ..types.list_accounts_response import ListAccountsResponse
910
from .raw_client import AsyncRawAccountsClient, RawAccountsClient
1011

1112
# this is used as the default value for optional parameters
@@ -38,7 +39,7 @@ def list(
3839
app: typing.Optional[str] = None,
3940
include_credentials: typing.Optional[bool] = None,
4041
request_options: typing.Optional[RequestOptions] = None,
41-
) -> SyncPager[Account]:
42+
) -> SyncPager[Account, ListAccountsResponse]:
4243
"""
4344
Retrieve all connected accounts for the project with optional filtering
4445
@@ -69,7 +70,7 @@ def list(
6970
7071
Returns
7172
-------
72-
SyncPager[Account]
73+
SyncPager[Account, ListAccountsResponse]
7374
accounts listed
7475
7576
Examples
@@ -82,7 +83,15 @@ def list(
8283
client_id="YOUR_CLIENT_ID",
8384
client_secret="YOUR_CLIENT_SECRET",
8485
)
85-
response = client.accounts.list()
86+
response = client.accounts.list(
87+
external_user_id="external_user_id",
88+
oauth_app_id="oauth_app_id",
89+
after="after",
90+
before="before",
91+
limit=1,
92+
app="app",
93+
include_credentials=True,
94+
)
8695
for item in response:
8796
yield item
8897
# alternatively, you can paginate page-by-page
@@ -152,6 +161,8 @@ def create(
152161
client_secret="YOUR_CLIENT_SECRET",
153162
)
154163
client.accounts.create(
164+
external_user_id="external_user_id",
165+
oauth_app_id="oauth_app_id",
155166
app_slug="app_slug",
156167
cfmap_json="cfmap_json",
157168
connect_token="connect_token",
@@ -205,6 +216,7 @@ def retrieve(
205216
)
206217
client.accounts.retrieve(
207218
account_id="account_id",
219+
include_credentials=True,
208220
)
209221
"""
210222
_response = self._raw_client.retrieve(
@@ -303,7 +315,7 @@ async def list(
303315
app: typing.Optional[str] = None,
304316
include_credentials: typing.Optional[bool] = None,
305317
request_options: typing.Optional[RequestOptions] = None,
306-
) -> AsyncPager[Account]:
318+
) -> AsyncPager[Account, ListAccountsResponse]:
307319
"""
308320
Retrieve all connected accounts for the project with optional filtering
309321
@@ -334,7 +346,7 @@ async def list(
334346
335347
Returns
336348
-------
337-
AsyncPager[Account]
349+
AsyncPager[Account, ListAccountsResponse]
338350
accounts listed
339351
340352
Examples
@@ -352,7 +364,15 @@ async def list(
352364
353365
354366
async def main() -> None:
355-
response = await client.accounts.list()
367+
response = await client.accounts.list(
368+
external_user_id="external_user_id",
369+
oauth_app_id="oauth_app_id",
370+
after="after",
371+
before="before",
372+
limit=1,
373+
app="app",
374+
include_credentials=True,
375+
)
356376
async for item in response:
357377
yield item
358378
@@ -431,6 +451,8 @@ async def create(
431451
432452
async def main() -> None:
433453
await client.accounts.create(
454+
external_user_id="external_user_id",
455+
oauth_app_id="oauth_app_id",
434456
app_slug="app_slug",
435457
cfmap_json="cfmap_json",
436458
connect_token="connect_token",
@@ -492,6 +514,7 @@ async def retrieve(
492514
async def main() -> None:
493515
await client.accounts.retrieve(
494516
account_id="account_id",
517+
include_credentials=True,
495518
)
496519
497520

0 commit comments

Comments
 (0)