Skip to content

Commit 8df16ff

Browse files
SDK regeneration
1 parent 4689a96 commit 8df16ff

File tree

77 files changed

+2766
-1689
lines changed

Some content is hidden

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

77 files changed

+2766
-1689
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.4.3",
3+
"generatorName": "fernapi/fern-python-sdk",
4+
"generatorVersion": "4.37.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: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,30 @@ client = Pipedream(
104104
client_id="YOUR_CLIENT_ID",
105105
client_secret="YOUR_CLIENT_SECRET",
106106
)
107-
response = client.apps.list()
107+
response = client.apps.list(
108+
after="after",
109+
before="before",
110+
limit=1,
111+
q="q",
112+
sort_key="name",
113+
sort_direction="asc",
114+
)
108115
for item in response:
109116
yield item
110117
# alternatively, you can paginate page-by-page
111118
for page in response.iter_pages():
112119
yield page
113120
```
114121

122+
```python
123+
# You can also iterate through pages and access the typed response per page
124+
pager = client.apps.list(...)
125+
for page in pager.iter_pages():
126+
print(page.response) # access the typed response for each page
127+
for item in page:
128+
print(item)
129+
```
130+
115131
## Advanced
116132

117133
### Access Raw Response Data
@@ -129,11 +145,11 @@ response = client.actions.with_raw_response.run(...)
129145
print(response.headers) # access the response headers
130146
print(response.data) # access the underlying object
131147
pager = client.apps.list(...)
132-
print(pager.response.headers) # access the response headers for the first page
148+
print(pager.response) # access the typed response for the first page
133149
for item in pager:
134150
print(item) # access the underlying object(s)
135151
for page in pager.iter_pages():
136-
print(page.response.headers) # access the response headers for each page
152+
print(page.response) # access the typed response for each page
137153
for item in page:
138154
print(item) # access the underlying object(s)
139155
```

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "pipedream"
33

44
[tool.poetry]
55
name = "pipedream"
6-
version = "1.0.12"
6+
version = "1.0.13"
77
description = ""
88
readme = "README.md"
99
authors = []
@@ -30,7 +30,7 @@ packages = [
3030
{ include = "pipedream", from = "src"}
3131
]
3232

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

3636
[tool.poetry.dependencies]

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

src/pipedream/accounts/raw_client.py

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
88
from ..core.http_response import AsyncHttpResponse, HttpResponse
99
from ..core.jsonable_encoder import jsonable_encoder
10-
from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
10+
from ..core.pagination import AsyncPager, SyncPager
1111
from ..core.pydantic_utilities import parse_obj_as
1212
from ..core.request_options import RequestOptions
1313
from ..errors.too_many_requests_error import TooManyRequestsError
@@ -33,7 +33,7 @@ def list(
3333
app: typing.Optional[str] = None,
3434
include_credentials: typing.Optional[bool] = None,
3535
request_options: typing.Optional[RequestOptions] = None,
36-
) -> SyncPager[Account]:
36+
) -> SyncPager[Account, ListAccountsResponse]:
3737
"""
3838
Retrieve all connected accounts for the project with optional filtering
3939
@@ -64,7 +64,7 @@ def list(
6464
6565
Returns
6666
-------
67-
SyncPager[Account]
67+
SyncPager[Account, ListAccountsResponse]
6868
accounts listed
6969
"""
7070
_response = self._client_wrapper.httpx_client.request(
@@ -106,16 +106,14 @@ def list(
106106
include_credentials=include_credentials,
107107
request_options=request_options,
108108
)
109-
return SyncPager(
110-
has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
111-
)
109+
return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
112110
if _response.status_code == 429:
113111
raise TooManyRequestsError(
114112
headers=dict(_response.headers),
115113
body=typing.cast(
116-
typing.Optional[typing.Any],
114+
typing.Any,
117115
parse_obj_as(
118-
type_=typing.Optional[typing.Any], # type: ignore
116+
type_=typing.Any, # type: ignore
119117
object_=_response.json(),
120118
),
121119
),
@@ -199,9 +197,9 @@ def create(
199197
raise TooManyRequestsError(
200198
headers=dict(_response.headers),
201199
body=typing.cast(
202-
typing.Optional[typing.Any],
200+
typing.Any,
203201
parse_obj_as(
204-
type_=typing.Optional[typing.Any], # type: ignore
202+
type_=typing.Any, # type: ignore
205203
object_=_response.json(),
206204
),
207205
),
@@ -258,9 +256,9 @@ def retrieve(
258256
raise TooManyRequestsError(
259257
headers=dict(_response.headers),
260258
body=typing.cast(
261-
typing.Optional[typing.Any],
259+
typing.Any,
262260
parse_obj_as(
263-
type_=typing.Optional[typing.Any], # type: ignore
261+
type_=typing.Any, # type: ignore
264262
object_=_response.json(),
265263
),
266264
),
@@ -297,9 +295,9 @@ def delete(self, account_id: str, *, request_options: typing.Optional[RequestOpt
297295
raise TooManyRequestsError(
298296
headers=dict(_response.headers),
299297
body=typing.cast(
300-
typing.Optional[typing.Any],
298+
typing.Any,
301299
parse_obj_as(
302-
type_=typing.Optional[typing.Any], # type: ignore
300+
type_=typing.Any, # type: ignore
303301
object_=_response.json(),
304302
),
305303
),
@@ -338,9 +336,9 @@ def delete_by_app(
338336
raise TooManyRequestsError(
339337
headers=dict(_response.headers),
340338
body=typing.cast(
341-
typing.Optional[typing.Any],
339+
typing.Any,
342340
parse_obj_as(
343-
type_=typing.Optional[typing.Any], # type: ignore
341+
type_=typing.Any, # type: ignore
344342
object_=_response.json(),
345343
),
346344
),
@@ -366,7 +364,7 @@ async def list(
366364
app: typing.Optional[str] = None,
367365
include_credentials: typing.Optional[bool] = None,
368366
request_options: typing.Optional[RequestOptions] = None,
369-
) -> AsyncPager[Account]:
367+
) -> AsyncPager[Account, ListAccountsResponse]:
370368
"""
371369
Retrieve all connected accounts for the project with optional filtering
372370
@@ -397,7 +395,7 @@ async def list(
397395
398396
Returns
399397
-------
400-
AsyncPager[Account]
398+
AsyncPager[Account, ListAccountsResponse]
401399
accounts listed
402400
"""
403401
_response = await self._client_wrapper.httpx_client.request(
@@ -442,16 +440,14 @@ async def _get_next():
442440
request_options=request_options,
443441
)
444442

445-
return AsyncPager(
446-
has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
447-
)
443+
return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
448444
if _response.status_code == 429:
449445
raise TooManyRequestsError(
450446
headers=dict(_response.headers),
451447
body=typing.cast(
452-
typing.Optional[typing.Any],
448+
typing.Any,
453449
parse_obj_as(
454-
type_=typing.Optional[typing.Any], # type: ignore
450+
type_=typing.Any, # type: ignore
455451
object_=_response.json(),
456452
),
457453
),
@@ -535,9 +531,9 @@ async def create(
535531
raise TooManyRequestsError(
536532
headers=dict(_response.headers),
537533
body=typing.cast(
538-
typing.Optional[typing.Any],
534+
typing.Any,
539535
parse_obj_as(
540-
type_=typing.Optional[typing.Any], # type: ignore
536+
type_=typing.Any, # type: ignore
541537
object_=_response.json(),
542538
),
543539
),
@@ -594,9 +590,9 @@ async def retrieve(
594590
raise TooManyRequestsError(
595591
headers=dict(_response.headers),
596592
body=typing.cast(
597-
typing.Optional[typing.Any],
593+
typing.Any,
598594
parse_obj_as(
599-
type_=typing.Optional[typing.Any], # type: ignore
595+
type_=typing.Any, # type: ignore
600596
object_=_response.json(),
601597
),
602598
),
@@ -635,9 +631,9 @@ async def delete(
635631
raise TooManyRequestsError(
636632
headers=dict(_response.headers),
637633
body=typing.cast(
638-
typing.Optional[typing.Any],
634+
typing.Any,
639635
parse_obj_as(
640-
type_=typing.Optional[typing.Any], # type: ignore
636+
type_=typing.Any, # type: ignore
641637
object_=_response.json(),
642638
),
643639
),
@@ -676,9 +672,9 @@ async def delete_by_app(
676672
raise TooManyRequestsError(
677673
headers=dict(_response.headers),
678674
body=typing.cast(
679-
typing.Optional[typing.Any],
675+
typing.Any,
680676
parse_obj_as(
681-
type_=typing.Optional[typing.Any], # type: ignore
677+
type_=typing.Any, # type: ignore
682678
object_=_response.json(),
683679
),
684680
),

0 commit comments

Comments
 (0)