Skip to content

🌿 Fern Regeneration -- July 15, 2025 #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
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.

2 changes: 1 addition & 1 deletion 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 = "0.3.1"
version = "0.3.2"
description = ""
readme = "README.md"
authors = []
Expand Down
30 changes: 15 additions & 15 deletions src/pipedream/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,38 @@ def __init__(
*,
project_id: str,
x_pd_environment: typing.Optional[str] = None,
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
access_token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
headers: typing.Optional[typing.Dict[str, str]] = None,
base_url: str,
timeout: typing.Optional[float] = None,
):
self._project_id = project_id
self._x_pd_environment = x_pd_environment
self._token = token
self._access_token = access_token
self._headers = headers
self._base_url = base_url
self._timeout = timeout

def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"User-Agent": "pipedream/0.3.1",
"User-Agent": "pipedream/0.3.2",
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "pipedream",
"X-Fern-SDK-Version": "0.3.1",
"X-Fern-SDK-Version": "0.3.2",
**(self.get_custom_headers() or {}),
}
if self._x_pd_environment is not None:
headers["x-pd-environment"] = self._x_pd_environment
token = self._get_token()
if token is not None:
headers["Authorization"] = f"Bearer {token}"
access_token = self._get_access_token()
if access_token is not None:
headers["Authorization"] = f"Bearer {access_token}"
return headers

def _get_token(self) -> typing.Optional[str]:
if isinstance(self._token, str) or self._token is None:
return self._token
def _get_access_token(self) -> typing.Optional[str]:
if isinstance(self._access_token, str) or self._access_token is None:
return self._access_token
else:
return self._token()
return self._access_token()

def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]:
return self._headers
Expand All @@ -61,7 +61,7 @@ def __init__(
*,
project_id: str,
x_pd_environment: typing.Optional[str] = None,
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
access_token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
headers: typing.Optional[typing.Dict[str, str]] = None,
base_url: str,
timeout: typing.Optional[float] = None,
Expand All @@ -70,7 +70,7 @@ def __init__(
super().__init__(
project_id=project_id,
x_pd_environment=x_pd_environment,
token=token,
access_token=access_token,
headers=headers,
base_url=base_url,
timeout=timeout,
Expand All @@ -89,7 +89,7 @@ def __init__(
*,
project_id: str,
x_pd_environment: typing.Optional[str] = None,
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
access_token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
headers: typing.Optional[typing.Dict[str, str]] = None,
base_url: str,
timeout: typing.Optional[float] = None,
Expand All @@ -98,7 +98,7 @@ def __init__(
super().__init__(
project_id=project_id,
x_pd_environment=x_pd_environment,
token=token,
access_token=access_token,
headers=headers,
base_url=base_url,
timeout=timeout,
Expand Down
Loading