Skip to content
Open
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
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 = "1.0.12"
version = "1.0.13"
description = ""
readme = "README.md"
authors = []
Expand Down
30 changes: 30 additions & 0 deletions src/pipedream/actions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,33 @@

# isort: skip_file

import typing
from importlib import import_module

if typing.TYPE_CHECKING:
from .types import ListActionsRequestRegistry
_dynamic_imports: typing.Dict[str, str] = {"ListActionsRequestRegistry": ".types"}


def __getattr__(attr_name: str) -> typing.Any:
module_name = _dynamic_imports.get(attr_name)
if module_name is None:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e


def __dir__():
lazy_attrs = list(_dynamic_imports.keys())
return sorted(lazy_attrs)


__all__ = ["ListActionsRequestRegistry"]
17 changes: 13 additions & 4 deletions src/pipedream/actions/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from ..types.run_action_opts_stash_id import RunActionOptsStashId
from ..types.run_action_response import RunActionResponse
from .raw_client import AsyncRawActionsClient, RawActionsClient
from .types.list_actions_request_registry import ListActionsRequestRegistry

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
Expand Down Expand Up @@ -40,6 +41,7 @@ def list(
limit: typing.Optional[int] = None,
q: typing.Optional[str] = None,
app: typing.Optional[str] = None,
registry: typing.Optional[ListActionsRequestRegistry] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> SyncPager[Component]:
"""
Expand All @@ -62,13 +64,16 @@ def list(
app : typing.Optional[str]
The ID or name slug of the app to filter the actions

registry : typing.Optional[ListActionsRequestRegistry]
The registry to retrieve actions from. Defaults to 'all' ('public', 'private', or 'all')

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
SyncPager[Component]
actions listed
behaves like registry=all

Examples
--------
Expand All @@ -88,7 +93,7 @@ def list(
yield page
"""
return self._raw_client.list(
after=after, before=before, limit=limit, q=q, app=app, request_options=request_options
after=after, before=before, limit=limit, q=q, app=app, registry=registry, request_options=request_options
)

def retrieve(
Expand Down Expand Up @@ -380,6 +385,7 @@ async def list(
limit: typing.Optional[int] = None,
q: typing.Optional[str] = None,
app: typing.Optional[str] = None,
registry: typing.Optional[ListActionsRequestRegistry] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncPager[Component]:
"""
Expand All @@ -402,13 +408,16 @@ async def list(
app : typing.Optional[str]
The ID or name slug of the app to filter the actions

registry : typing.Optional[ListActionsRequestRegistry]
The registry to retrieve actions from. Defaults to 'all' ('public', 'private', or 'all')

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
AsyncPager[Component]
actions listed
behaves like registry=all

Examples
--------
Expand Down Expand Up @@ -437,7 +446,7 @@ async def main() -> None:
asyncio.run(main())
"""
return await self._raw_client.list(
after=after, before=before, limit=limit, q=q, app=app, request_options=request_options
after=after, before=before, limit=limit, q=q, app=app, registry=registry, request_options=request_options
)

async def retrieve(
Expand Down
40 changes: 38 additions & 2 deletions src/pipedream/actions/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
from ..errors.bad_request_error import BadRequestError
from ..errors.too_many_requests_error import TooManyRequestsError
from ..types.component import Component
from ..types.configure_prop_response import ConfigurePropResponse
Expand All @@ -20,6 +21,7 @@
from ..types.reload_props_response import ReloadPropsResponse
from ..types.run_action_opts_stash_id import RunActionOptsStashId
from ..types.run_action_response import RunActionResponse
from .types.list_actions_request_registry import ListActionsRequestRegistry

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
Expand All @@ -37,6 +39,7 @@ def list(
limit: typing.Optional[int] = None,
q: typing.Optional[str] = None,
app: typing.Optional[str] = None,
registry: typing.Optional[ListActionsRequestRegistry] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> SyncPager[Component]:
"""
Expand All @@ -59,13 +62,16 @@ def list(
app : typing.Optional[str]
The ID or name slug of the app to filter the actions

registry : typing.Optional[ListActionsRequestRegistry]
The registry to retrieve actions from. Defaults to 'all' ('public', 'private', or 'all')

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
SyncPager[Component]
actions listed
behaves like registry=all
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/actions",
Expand All @@ -76,6 +82,7 @@ def list(
"limit": limit,
"q": q,
"app": app,
"registry": registry,
},
request_options=request_options,
)
Expand All @@ -100,11 +107,23 @@ def list(
limit=limit,
q=q,
app=app,
registry=registry,
request_options=request_options,
)
return SyncPager(
has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
)
if _response.status_code == 400:
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
Expand Down Expand Up @@ -474,6 +493,7 @@ async def list(
limit: typing.Optional[int] = None,
q: typing.Optional[str] = None,
app: typing.Optional[str] = None,
registry: typing.Optional[ListActionsRequestRegistry] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncPager[Component]:
"""
Expand All @@ -496,13 +516,16 @@ async def list(
app : typing.Optional[str]
The ID or name slug of the app to filter the actions

registry : typing.Optional[ListActionsRequestRegistry]
The registry to retrieve actions from. Defaults to 'all' ('public', 'private', or 'all')

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
AsyncPager[Component]
actions listed
behaves like registry=all
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/connect/{jsonable_encoder(self._client_wrapper._project_id)}/actions",
Expand All @@ -513,6 +536,7 @@ async def list(
"limit": limit,
"q": q,
"app": app,
"registry": registry,
},
request_options=request_options,
)
Expand All @@ -539,12 +563,24 @@ async def _get_next():
limit=limit,
q=q,
app=app,
registry=registry,
request_options=request_options,
)

return AsyncPager(
has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
)
if _response.status_code == 400:
raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
Expand Down
34 changes: 34 additions & 0 deletions src/pipedream/actions/types/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This file was auto-generated by Fern from our API Definition.

# isort: skip_file

import typing
from importlib import import_module

if typing.TYPE_CHECKING:
from .list_actions_request_registry import ListActionsRequestRegistry
_dynamic_imports: typing.Dict[str, str] = {"ListActionsRequestRegistry": ".list_actions_request_registry"}


def __getattr__(attr_name: str) -> typing.Any:
module_name = _dynamic_imports.get(attr_name)
if module_name is None:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e


def __dir__():
lazy_attrs = list(_dynamic_imports.keys())
return sorted(lazy_attrs)


__all__ = ["ListActionsRequestRegistry"]
5 changes: 5 additions & 0 deletions src/pipedream/actions/types/list_actions_request_registry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file was auto-generated by Fern from our API Definition.

import typing

ListActionsRequestRegistry = typing.Union[typing.Literal["public", "private", "all"], typing.Any]
6 changes: 3 additions & 3 deletions src/pipedream/apps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from importlib import import_module

if typing.TYPE_CHECKING:
from .types import AppsListRequestSortDirection, AppsListRequestSortKey
_dynamic_imports: typing.Dict[str, str] = {"AppsListRequestSortDirection": ".types", "AppsListRequestSortKey": ".types"}
from .types import ListAppsRequestSortDirection, ListAppsRequestSortKey
_dynamic_imports: typing.Dict[str, str] = {"ListAppsRequestSortDirection": ".types", "ListAppsRequestSortKey": ".types"}


def __getattr__(attr_name: str) -> typing.Any:
Expand All @@ -31,4 +31,4 @@ def __dir__():
return sorted(lazy_attrs)


__all__ = ["AppsListRequestSortDirection", "AppsListRequestSortKey"]
__all__ = ["ListAppsRequestSortDirection", "ListAppsRequestSortKey"]
20 changes: 10 additions & 10 deletions src/pipedream/apps/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from ..types.app import App
from ..types.get_app_response import GetAppResponse
from .raw_client import AsyncRawAppsClient, RawAppsClient
from .types.apps_list_request_sort_direction import AppsListRequestSortDirection
from .types.apps_list_request_sort_key import AppsListRequestSortKey
from .types.list_apps_request_sort_direction import ListAppsRequestSortDirection
from .types.list_apps_request_sort_key import ListAppsRequestSortKey


class AppsClient:
Expand All @@ -34,8 +34,8 @@ def list(
before: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
q: typing.Optional[str] = None,
sort_key: typing.Optional[AppsListRequestSortKey] = None,
sort_direction: typing.Optional[AppsListRequestSortDirection] = None,
sort_key: typing.Optional[ListAppsRequestSortKey] = None,
sort_direction: typing.Optional[ListAppsRequestSortDirection] = None,
category_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> SyncPager[App]:
Expand All @@ -56,10 +56,10 @@ def list(
q : typing.Optional[str]
A search query to filter the apps

sort_key : typing.Optional[AppsListRequestSortKey]
sort_key : typing.Optional[ListAppsRequestSortKey]
The key to sort the apps by

sort_direction : typing.Optional[AppsListRequestSortDirection]
sort_direction : typing.Optional[ListAppsRequestSortDirection]
The direction to sort the apps

category_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
Expand Down Expand Up @@ -158,8 +158,8 @@ async def list(
before: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
q: typing.Optional[str] = None,
sort_key: typing.Optional[AppsListRequestSortKey] = None,
sort_direction: typing.Optional[AppsListRequestSortDirection] = None,
sort_key: typing.Optional[ListAppsRequestSortKey] = None,
sort_direction: typing.Optional[ListAppsRequestSortDirection] = None,
category_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncPager[App]:
Expand All @@ -180,10 +180,10 @@ async def list(
q : typing.Optional[str]
A search query to filter the apps

sort_key : typing.Optional[AppsListRequestSortKey]
sort_key : typing.Optional[ListAppsRequestSortKey]
The key to sort the apps by

sort_direction : typing.Optional[AppsListRequestSortDirection]
sort_direction : typing.Optional[ListAppsRequestSortDirection]
The direction to sort the apps

category_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
Expand Down
Loading
Loading