Skip to content

Commit 6a6be95

Browse files
committed
SDK regeneration
1 parent 81fdaa4 commit 6a6be95

File tree

9 files changed

+259
-6
lines changed

9 files changed

+259
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
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.7"
6+
version = "1.0.8"
77
description = ""
88
readme = "README.md"
99
authors = []

src/pipedream/client.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import typing
77

88
import httpx
9-
from .types.project_environment import ProjectEnvironment
9+
from ._.types.project_environment import ProjectEnvironment
1010
from .core.api_error import ApiError
1111
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
1212
from .core.oauth_token_provider import OAuthTokenProvider
@@ -19,6 +19,7 @@
1919
from .apps.client import AppsClient, AsyncAppsClient
2020
from .components.client import AsyncComponentsClient, ComponentsClient
2121
from .deployed_triggers.client import AsyncDeployedTriggersClient, DeployedTriggersClient
22+
from .file_stash.client import AsyncFileStashClient, FileStashClient
2223
from .oauth_tokens.client import AsyncOauthTokensClient, OauthTokensClient
2324
from .projects.client import AsyncProjectsClient, ProjectsClient
2425
from .proxy.client import AsyncProxyClient, ProxyClient
@@ -130,6 +131,7 @@ def __init__(
130131
self._triggers: typing.Optional[TriggersClient] = None
131132
self._deployed_triggers: typing.Optional[DeployedTriggersClient] = None
132133
self._projects: typing.Optional[ProjectsClient] = None
134+
self._file_stash: typing.Optional[FileStashClient] = None
133135
self._proxy: typing.Optional[ProxyClient] = None
134136
self._tokens: typing.Optional[TokensClient] = None
135137
self._oauth_tokens: typing.Optional[OauthTokensClient] = None
@@ -206,6 +208,14 @@ def projects(self):
206208
self._projects = ProjectsClient(client_wrapper=self._client_wrapper)
207209
return self._projects
208210

211+
@property
212+
def file_stash(self):
213+
if self._file_stash is None:
214+
from .file_stash.client import FileStashClient # noqa: E402
215+
216+
self._file_stash = FileStashClient(client_wrapper=self._client_wrapper)
217+
return self._file_stash
218+
209219
@property
210220
def proxy(self):
211221
if self._proxy is None:
@@ -334,6 +344,7 @@ def __init__(
334344
self._triggers: typing.Optional[AsyncTriggersClient] = None
335345
self._deployed_triggers: typing.Optional[AsyncDeployedTriggersClient] = None
336346
self._projects: typing.Optional[AsyncProjectsClient] = None
347+
self._file_stash: typing.Optional[AsyncFileStashClient] = None
337348
self._proxy: typing.Optional[AsyncProxyClient] = None
338349
self._tokens: typing.Optional[AsyncTokensClient] = None
339350
self._oauth_tokens: typing.Optional[AsyncOauthTokensClient] = None
@@ -410,6 +421,14 @@ def projects(self):
410421
self._projects = AsyncProjectsClient(client_wrapper=self._client_wrapper)
411422
return self._projects
412423

424+
@property
425+
def file_stash(self):
426+
if self._file_stash is None:
427+
from .file_stash.client import AsyncFileStashClient # noqa: E402
428+
429+
self._file_stash = AsyncFileStashClient(client_wrapper=self._client_wrapper)
430+
return self._file_stash
431+
413432
@property
414433
def proxy(self):
415434
if self._proxy is None:

src/pipedream/core/client_wrapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import typing
44

55
import httpx
6-
from ..types.project_environment import ProjectEnvironment
6+
from .._.types.project_environment import ProjectEnvironment
77
from .http_client import AsyncHttpClient, HttpClient
88

99

@@ -27,10 +27,10 @@ def __init__(
2727

2828
def get_headers(self) -> typing.Dict[str, str]:
2929
headers: typing.Dict[str, str] = {
30-
"User-Agent": "pipedream/1.0.7",
30+
"User-Agent": "pipedream/1.0.8",
3131
"X-Fern-Language": "Python",
3232
"X-Fern-SDK-Name": "pipedream",
33-
"X-Fern-SDK-Version": "1.0.7",
33+
"X-Fern-SDK-Version": "1.0.8",
3434
**(self.get_custom_headers() or {}),
3535
}
3636
if self._project_environment is not None:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
# isort: skip_file
4+

src/pipedream/file_stash/client.py

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import typing
4+
5+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6+
from ..core.request_options import RequestOptions
7+
from .raw_client import AsyncRawFileStashClient, RawFileStashClient
8+
9+
10+
class FileStashClient:
11+
def __init__(self, *, client_wrapper: SyncClientWrapper):
12+
self._raw_client = RawFileStashClient(client_wrapper=client_wrapper)
13+
14+
@property
15+
def with_raw_response(self) -> RawFileStashClient:
16+
"""
17+
Retrieves a raw implementation of this client that returns raw responses.
18+
19+
Returns
20+
-------
21+
RawFileStashClient
22+
"""
23+
return self._raw_client
24+
25+
def download_file(self, *, s_3_key: str, request_options: typing.Optional[RequestOptions] = None) -> None:
26+
"""
27+
Download a file from File Stash
28+
29+
Parameters
30+
----------
31+
s_3_key : str
32+
33+
request_options : typing.Optional[RequestOptions]
34+
Request-specific configuration.
35+
36+
Returns
37+
-------
38+
None
39+
40+
Examples
41+
--------
42+
from pipedream import Pipedream
43+
44+
client = Pipedream(
45+
project_id="YOUR_PROJECT_ID",
46+
project_environment="YOUR_PROJECT_ENVIRONMENT",
47+
client_id="YOUR_CLIENT_ID",
48+
client_secret="YOUR_CLIENT_SECRET",
49+
)
50+
client.file_stash.download_file(
51+
s_3_key="s3_key",
52+
)
53+
"""
54+
_response = self._raw_client.download_file(s_3_key=s_3_key, request_options=request_options)
55+
return _response.data
56+
57+
58+
class AsyncFileStashClient:
59+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
60+
self._raw_client = AsyncRawFileStashClient(client_wrapper=client_wrapper)
61+
62+
@property
63+
def with_raw_response(self) -> AsyncRawFileStashClient:
64+
"""
65+
Retrieves a raw implementation of this client that returns raw responses.
66+
67+
Returns
68+
-------
69+
AsyncRawFileStashClient
70+
"""
71+
return self._raw_client
72+
73+
async def download_file(self, *, s_3_key: str, request_options: typing.Optional[RequestOptions] = None) -> None:
74+
"""
75+
Download a file from File Stash
76+
77+
Parameters
78+
----------
79+
s_3_key : str
80+
81+
request_options : typing.Optional[RequestOptions]
82+
Request-specific configuration.
83+
84+
Returns
85+
-------
86+
None
87+
88+
Examples
89+
--------
90+
import asyncio
91+
92+
from pipedream import AsyncPipedream
93+
94+
client = AsyncPipedream(
95+
project_id="YOUR_PROJECT_ID",
96+
project_environment="YOUR_PROJECT_ENVIRONMENT",
97+
client_id="YOUR_CLIENT_ID",
98+
client_secret="YOUR_CLIENT_SECRET",
99+
)
100+
101+
102+
async def main() -> None:
103+
await client.file_stash.download_file(
104+
s_3_key="s3_key",
105+
)
106+
107+
108+
asyncio.run(main())
109+
"""
110+
_response = await self._raw_client.download_file(s_3_key=s_3_key, request_options=request_options)
111+
return _response.data
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import typing
4+
from json.decoder import JSONDecodeError
5+
6+
from ..core.api_error import ApiError
7+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8+
from ..core.http_response import AsyncHttpResponse, HttpResponse
9+
from ..core.jsonable_encoder import jsonable_encoder
10+
from ..core.pydantic_utilities import parse_obj_as
11+
from ..core.request_options import RequestOptions
12+
from ..errors.too_many_requests_error import TooManyRequestsError
13+
14+
15+
class RawFileStashClient:
16+
def __init__(self, *, client_wrapper: SyncClientWrapper):
17+
self._client_wrapper = client_wrapper
18+
19+
def download_file(
20+
self, *, s_3_key: str, request_options: typing.Optional[RequestOptions] = None
21+
) -> HttpResponse[None]:
22+
"""
23+
Download a file from File Stash
24+
25+
Parameters
26+
----------
27+
s_3_key : str
28+
29+
request_options : typing.Optional[RequestOptions]
30+
Request-specific configuration.
31+
32+
Returns
33+
-------
34+
HttpResponse[None]
35+
"""
36+
_response = self._client_wrapper.httpx_client.request(
37+
f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/file_stash/download",
38+
method="GET",
39+
params={
40+
"s3_key": s_3_key,
41+
},
42+
request_options=request_options,
43+
)
44+
try:
45+
if 200 <= _response.status_code < 300:
46+
return HttpResponse(response=_response, data=None)
47+
if _response.status_code == 429:
48+
raise TooManyRequestsError(
49+
headers=dict(_response.headers),
50+
body=typing.cast(
51+
typing.Optional[typing.Any],
52+
parse_obj_as(
53+
type_=typing.Optional[typing.Any], # type: ignore
54+
object_=_response.json(),
55+
),
56+
),
57+
)
58+
_response_json = _response.json()
59+
except JSONDecodeError:
60+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
61+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
62+
63+
64+
class AsyncRawFileStashClient:
65+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
66+
self._client_wrapper = client_wrapper
67+
68+
async def download_file(
69+
self, *, s_3_key: str, request_options: typing.Optional[RequestOptions] = None
70+
) -> AsyncHttpResponse[None]:
71+
"""
72+
Download a file from File Stash
73+
74+
Parameters
75+
----------
76+
s_3_key : str
77+
78+
request_options : typing.Optional[RequestOptions]
79+
Request-specific configuration.
80+
81+
Returns
82+
-------
83+
AsyncHttpResponse[None]
84+
"""
85+
_response = await self._client_wrapper.httpx_client.request(
86+
f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/file_stash/download",
87+
method="GET",
88+
params={
89+
"s3_key": s_3_key,
90+
},
91+
request_options=request_options,
92+
)
93+
try:
94+
if 200 <= _response.status_code < 300:
95+
return AsyncHttpResponse(response=_response, data=None)
96+
if _response.status_code == 429:
97+
raise TooManyRequestsError(
98+
headers=dict(_response.headers),
99+
body=typing.cast(
100+
typing.Optional[typing.Any],
101+
parse_obj_as(
102+
type_=typing.Optional[typing.Any], # type: ignore
103+
object_=_response.json(),
104+
),
105+
),
106+
)
107+
_response_json = _response.json()
108+
except JSONDecodeError:
109+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
110+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

src/pipedream/types/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
from .project_info_response_app import ProjectInfoResponseApp
9090
from .prop_option import PropOption
9191
from .prop_option_nested import PropOptionNested
92+
from .prop_option_value import PropOptionValue
9293
from .proxy_response import ProxyResponse
9394
from .reload_props_opts import ReloadPropsOpts
9495
from .reload_props_response import ReloadPropsResponse
@@ -184,6 +185,7 @@
184185
"ProjectInfoResponseApp": ".project_info_response_app",
185186
"PropOption": ".prop_option",
186187
"PropOptionNested": ".prop_option_nested",
188+
"PropOptionValue": ".prop_option_value",
187189
"ProxyResponse": ".proxy_response",
188190
"ReloadPropsOpts": ".reload_props_opts",
189191
"ReloadPropsResponse": ".reload_props_response",
@@ -301,6 +303,7 @@ def __dir__():
301303
"ProjectInfoResponseApp",
302304
"PropOption",
303305
"PropOptionNested",
306+
"PropOptionValue",
304307
"ProxyResponse",
305308
"ReloadPropsOpts",
306309
"ReloadPropsResponse",

src/pipedream/types/prop_option.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import pydantic
66
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7+
from .prop_option_value import PropOptionValue
78

89

910
class PropOption(UniversalBaseModel):
@@ -16,7 +17,7 @@ class PropOption(UniversalBaseModel):
1617
The human-readable label for the option
1718
"""
1819

19-
value: typing.Optional[typing.Any] = None
20+
value: PropOptionValue
2021

2122
if IS_PYDANTIC_V2:
2223
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import typing
4+
5+
PropOptionValue = typing.Union[str, int, bool]

0 commit comments

Comments
 (0)