Skip to content

Commit 497b259

Browse files
Create explicit schemas for enums (#62)
To avoid Fern automatically creating types for enums, we now define them explicitly so that we control the outcome. --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Jay Vercellone <[email protected]>
1 parent 504c1df commit 497b259

26 files changed

+86
-192
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.4"
6+
version = "1.0.5"
77
description = ""
88
readme = "README.md"
99
authors = []

src/pipedream/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
ComponentStash,
1414
ConfigurableProp,
1515
ConfigurablePropAlert,
16-
ConfigurablePropAlertAlertType,
16+
ConfigurablePropAlertType,
1717
ConfigurablePropAny,
1818
ConfigurablePropApp,
1919
ConfigurablePropBoolean,
@@ -24,9 +24,7 @@
2424
ConfigurablePropStringArray,
2525
ConfigurePropOpts,
2626
ConfigurePropResponse,
27-
ConnectTokenCreateOpts,
28-
ConnectTokenResponse,
29-
CreateBrowserClientOpts,
27+
ConnectToken,
3028
CreateOAuthTokenResponse,
3129
CreateTokenResponse,
3230
DeleteTriggerOpts,
@@ -51,12 +49,14 @@
5149
PageInfo,
5250
ProjectEnvironment,
5351
ProjectInfoResponse,
54-
ProjectInfoResponseAppsItem,
52+
ProjectInfoResponseApp,
5553
PropOption,
5654
ProxyResponse,
5755
ReloadPropsOpts,
5856
ReloadPropsResponse,
5957
RunActionResponse,
58+
RunActionOptsStashId,
59+
StashId,
6060
StartConnectOpts,
6161
ValidateTokenParams,
6262
ValidateTokenResponse,
@@ -95,7 +95,7 @@
9595
"ComponentStash",
9696
"ConfigurableProp",
9797
"ConfigurablePropAlert",
98-
"ConfigurablePropAlertAlertType",
98+
"ConfigurablePropAlertType",
9999
"ConfigurablePropAny",
100100
"ConfigurablePropApp",
101101
"ConfigurablePropBoolean",
@@ -106,9 +106,7 @@
106106
"ConfigurablePropStringArray",
107107
"ConfigurePropOpts",
108108
"ConfigurePropResponse",
109-
"ConnectTokenCreateOpts",
110-
"ConnectTokenResponse",
111-
"CreateBrowserClientOpts",
109+
"ConnectToken",
112110
"CreateOAuthTokenResponse",
113111
"CreateTokenResponse",
114112
"DeleteTriggerOpts",
@@ -135,12 +133,14 @@
135133
"PipedreamEnvironment",
136134
"ProjectEnvironment",
137135
"ProjectInfoResponse",
138-
"ProjectInfoResponseAppsItem",
136+
"ProjectInfoResponseApp",
139137
"PropOption",
140138
"ProxyResponse",
141139
"ReloadPropsOpts",
142140
"ReloadPropsResponse",
143141
"RunActionResponse",
142+
"RunActionOptsStashId",
143+
"StashId",
144144
"StartConnectOpts",
145145
"ValidateTokenParams",
146146
"ValidateTokenResponse",

src/pipedream/actions/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@
22

33
# isort: skip_file
44

5-
from .types import RunActionOptsStashId
6-
7-
__all__ = ["RunActionOptsStashId"]

src/pipedream/actions/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
from ..types.component import Component
99
from ..types.configure_prop_response import ConfigurePropResponse
1010
from ..types.reload_props_response import ReloadPropsResponse
11+
from ..types.run_action_opts_stash_id import RunActionOptsStashId
1112
from ..types.run_action_response import RunActionResponse
1213
from .raw_client import AsyncRawActionsClient, RawActionsClient
13-
from .types.run_action_opts_stash_id import RunActionOptsStashId
1414

1515
# this is used as the default value for optional parameters
1616
OMIT = typing.cast(typing.Any, ...)
@@ -310,7 +310,6 @@ def run(
310310
The ID for dynamic props
311311
312312
stash_id : typing.Optional[RunActionOptsStashId]
313-
The ID of the File Stash to use for syncing the action's /tmp directory
314313
315314
request_options : typing.Optional[RequestOptions]
316315
Request-specific configuration.
@@ -676,7 +675,6 @@ async def run(
676675
The ID for dynamic props
677676
678677
stash_id : typing.Optional[RunActionOptsStashId]
679-
The ID of the File Stash to use for syncing the action's /tmp directory
680678
681679
request_options : typing.Optional[RequestOptions]
682680
Request-specific configuration.

src/pipedream/actions/raw_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
from ..types.get_component_response import GetComponentResponse
1717
from ..types.get_components_response import GetComponentsResponse
1818
from ..types.reload_props_response import ReloadPropsResponse
19+
from ..types.run_action_opts_stash_id import RunActionOptsStashId
1920
from ..types.run_action_response import RunActionResponse
20-
from .types.run_action_opts_stash_id import RunActionOptsStashId
2121

2222
# this is used as the default value for optional parameters
2323
OMIT = typing.cast(typing.Any, ...)
@@ -345,7 +345,6 @@ def run(
345345
The ID for dynamic props
346346
347347
stash_id : typing.Optional[RunActionOptsStashId]
348-
The ID of the File Stash to use for syncing the action's /tmp directory
349348
350349
request_options : typing.Optional[RequestOptions]
351350
Request-specific configuration.
@@ -715,7 +714,6 @@ async def run(
715714
The ID for dynamic props
716715
717716
stash_id : typing.Optional[RunActionOptsStashId]
718-
The ID of the File Stash to use for syncing the action's /tmp directory
719717
720718
request_options : typing.Optional[RequestOptions]
721719
Request-specific configuration.

src/pipedream/actions/types/__init__.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/pipedream/core/client_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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.4",
30+
"User-Agent": "pipedream/1.0.5",
3131
"X-Fern-Language": "Python",
3232
"X-Fern-SDK-Name": "pipedream",
33-
"X-Fern-SDK-Version": "1.0.4",
33+
"X-Fern-SDK-Version": "1.0.5",
3434
**(self.get_custom_headers() or {}),
3535
}
3636
if self._project_environment is not None:

src/pipedream/tokens/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
66
from ..core.request_options import RequestOptions
7+
from ..types.connect_token import ConnectToken
78
from ..types.create_token_response import CreateTokenResponse
89
from ..types.validate_token_params import ValidateTokenParams
910
from ..types.validate_token_response import ValidateTokenResponse
@@ -90,15 +91,15 @@ def create(
9091

9192
def validate(
9293
self,
93-
ctok: str,
94+
ctok: ConnectToken,
9495
*,
9596
params: typing.Optional[ValidateTokenParams] = None,
9697
request_options: typing.Optional[RequestOptions] = None,
9798
) -> ValidateTokenResponse:
9899
"""
99100
Parameters
100101
----------
101-
ctok : str
102+
ctok : ConnectToken
102103
103104
params : typing.Optional[ValidateTokenParams]
104105
@@ -213,15 +214,15 @@ async def main() -> None:
213214

214215
async def validate(
215216
self,
216-
ctok: str,
217+
ctok: ConnectToken,
217218
*,
218219
params: typing.Optional[ValidateTokenParams] = None,
219220
request_options: typing.Optional[RequestOptions] = None,
220221
) -> ValidateTokenResponse:
221222
"""
222223
Parameters
223224
----------
224-
ctok : str
225+
ctok : ConnectToken
225226
226227
params : typing.Optional[ValidateTokenParams]
227228

src/pipedream/tokens/raw_client.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from ..core.pydantic_utilities import parse_obj_as
1111
from ..core.request_options import RequestOptions
1212
from ..core.serialization import convert_and_respect_annotation_metadata
13+
from ..types.connect_token import ConnectToken
1314
from ..types.create_token_response import CreateTokenResponse
1415
from ..types.validate_token_params import ValidateTokenParams
1516
from ..types.validate_token_response import ValidateTokenResponse
@@ -91,15 +92,15 @@ def create(
9192

9293
def validate(
9394
self,
94-
ctok: str,
95+
ctok: ConnectToken,
9596
*,
9697
params: typing.Optional[ValidateTokenParams] = None,
9798
request_options: typing.Optional[RequestOptions] = None,
9899
) -> HttpResponse[ValidateTokenResponse]:
99100
"""
100101
Parameters
101102
----------
102-
ctok : str
103+
ctok : ConnectToken
103104
104105
params : typing.Optional[ValidateTokenParams]
105106
@@ -112,7 +113,7 @@ def validate(
112113
connect token validated
113114
"""
114115
_response = self._client_wrapper.httpx_client.request(
115-
f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/tokens/{jsonable_encoder(ctok)}/validate",
116+
f"v1/connect/tokens/{jsonable_encoder(ctok)}/validate",
116117
method="GET",
117118
params={
118119
"params": convert_and_respect_annotation_metadata(
@@ -210,15 +211,15 @@ async def create(
210211

211212
async def validate(
212213
self,
213-
ctok: str,
214+
ctok: ConnectToken,
214215
*,
215216
params: typing.Optional[ValidateTokenParams] = None,
216217
request_options: typing.Optional[RequestOptions] = None,
217218
) -> AsyncHttpResponse[ValidateTokenResponse]:
218219
"""
219220
Parameters
220221
----------
221-
ctok : str
222+
ctok : ConnectToken
222223
223224
params : typing.Optional[ValidateTokenParams]
224225
@@ -231,7 +232,7 @@ async def validate(
231232
connect token validated
232233
"""
233234
_response = await self._client_wrapper.httpx_client.request(
234-
f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/tokens/{jsonable_encoder(ctok)}/validate",
235+
f"v1/connect/tokens/{jsonable_encoder(ctok)}/validate",
235236
method="GET",
236237
params={
237238
"params": convert_and_respect_annotation_metadata(

src/pipedream/types/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .component_stash import ComponentStash
1313
from .configurable_prop import ConfigurableProp
1414
from .configurable_prop_alert import ConfigurablePropAlert
15-
from .configurable_prop_alert_alert_type import ConfigurablePropAlertAlertType
15+
from .configurable_prop_alert_type import ConfigurablePropAlertType
1616
from .configurable_prop_any import ConfigurablePropAny
1717
from .configurable_prop_app import ConfigurablePropApp
1818
from .configurable_prop_boolean import ConfigurablePropBoolean
@@ -23,9 +23,7 @@
2323
from .configurable_prop_string_array import ConfigurablePropStringArray
2424
from .configure_prop_opts import ConfigurePropOpts
2525
from .configure_prop_response import ConfigurePropResponse
26-
from .connect_token_create_opts import ConnectTokenCreateOpts
27-
from .connect_token_response import ConnectTokenResponse
28-
from .create_browser_client_opts import CreateBrowserClientOpts
26+
from .connect_token import ConnectToken
2927
from .create_o_auth_token_response import CreateOAuthTokenResponse
3028
from .create_token_response import CreateTokenResponse
3129
from .delete_trigger_opts import DeleteTriggerOpts
@@ -50,13 +48,15 @@
5048
from .page_info import PageInfo
5149
from .project_environment import ProjectEnvironment
5250
from .project_info_response import ProjectInfoResponse
53-
from .project_info_response_apps_item import ProjectInfoResponseAppsItem
51+
from .project_info_response_app import ProjectInfoResponseApp
5452
from .prop_option import PropOption
5553
from .proxy_response import ProxyResponse
5654
from .reload_props_opts import ReloadPropsOpts
5755
from .reload_props_response import ReloadPropsResponse
56+
from .run_action_opts_stash_id import RunActionOptsStashId
5857
from .run_action_response import RunActionResponse
5958
from .start_connect_opts import StartConnectOpts
59+
from .stash_id import StashId
6060
from .validate_token_params import ValidateTokenParams
6161
from .validate_token_response import ValidateTokenResponse
6262

@@ -71,7 +71,7 @@
7171
"ComponentStash",
7272
"ConfigurableProp",
7373
"ConfigurablePropAlert",
74-
"ConfigurablePropAlertAlertType",
74+
"ConfigurablePropAlertType",
7575
"ConfigurablePropAny",
7676
"ConfigurablePropApp",
7777
"ConfigurablePropBoolean",
@@ -82,9 +82,7 @@
8282
"ConfigurablePropStringArray",
8383
"ConfigurePropOpts",
8484
"ConfigurePropResponse",
85-
"ConnectTokenCreateOpts",
86-
"ConnectTokenResponse",
87-
"CreateBrowserClientOpts",
85+
"ConnectToken",
8886
"CreateOAuthTokenResponse",
8987
"CreateTokenResponse",
9088
"DeleteTriggerOpts",
@@ -109,13 +107,15 @@
109107
"PageInfo",
110108
"ProjectEnvironment",
111109
"ProjectInfoResponse",
112-
"ProjectInfoResponseAppsItem",
110+
"ProjectInfoResponseApp",
113111
"PropOption",
114112
"ProxyResponse",
115113
"ReloadPropsOpts",
116114
"ReloadPropsResponse",
115+
"RunActionOptsStashId",
117116
"RunActionResponse",
118117
"StartConnectOpts",
118+
"StashId",
119119
"ValidateTokenParams",
120120
"ValidateTokenResponse",
121121
]

0 commit comments

Comments
 (0)