Skip to content
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ from pipedream import Pipedream
client = Pipedream(
...,
httpx_client=httpx.Client(
proxies="http://my.test.proxy.example.com",
proxy="http://my.test.proxy.example.com",
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
),
)
Expand Down
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.6"
version = "1.0.7"
description = ""
readme = "README.md"
authors = []
Expand Down
111 changes: 111 additions & 0 deletions src/pipedream/accounts/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..errors.too_many_requests_error import TooManyRequestsError
from ..types.account import Account
from ..types.list_accounts_response import ListAccountsResponse

Expand Down Expand Up @@ -108,6 +109,17 @@ def list(
return SyncPager(
has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down Expand Up @@ -188,6 +200,17 @@ def create(
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down Expand Up @@ -236,6 +259,17 @@ def retrieve(
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down Expand Up @@ -264,6 +298,17 @@ def delete(self, account_id: str, *, request_options: typing.Optional[RequestOpt
try:
if 200 <= _response.status_code < 300:
return HttpResponse(response=_response, data=None)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down Expand Up @@ -294,6 +339,17 @@ def delete_by_app(
try:
if 200 <= _response.status_code < 300:
return HttpResponse(response=_response, data=None)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down Expand Up @@ -394,6 +450,17 @@ async def _get_next():
return AsyncPager(
has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down Expand Up @@ -474,6 +541,17 @@ async def create(
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down Expand Up @@ -522,6 +600,17 @@ async def retrieve(
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down Expand Up @@ -552,6 +641,17 @@ async def delete(
try:
if 200 <= _response.status_code < 300:
return AsyncHttpResponse(response=_response, data=None)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down Expand Up @@ -582,6 +682,17 @@ async def delete_by_app(
try:
if 200 <= _response.status_code < 300:
return AsyncHttpResponse(response=_response, data=None)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down
31 changes: 18 additions & 13 deletions src/pipedream/actions/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from ..core.request_options import RequestOptions
from ..types.component import Component
from ..types.configure_prop_response import ConfigurePropResponse
from ..types.configured_props import ConfiguredProps
from ..types.reload_props_response import ReloadPropsResponse
from ..types.run_action_opts_stash_id import RunActionOptsStashId
from ..types.run_action_response import RunActionResponse
Expand Down Expand Up @@ -132,7 +131,7 @@ def configure_prop(
external_user_id: str,
prop_name: str,
blocking: typing.Optional[bool] = OMIT,
configured_props: typing.Optional[ConfiguredProps] = OMIT,
configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
dynamic_props_id: typing.Optional[str] = OMIT,
page: typing.Optional[float] = OMIT,
prev_context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
Expand All @@ -156,7 +155,8 @@ def configure_prop(
blocking : typing.Optional[bool]
Whether this operation should block until completion

configured_props : typing.Optional[ConfiguredProps]
configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
The configured properties for the component

dynamic_props_id : typing.Optional[str]
The ID for dynamic props
Expand Down Expand Up @@ -214,7 +214,7 @@ def reload_props(
id: str,
external_user_id: str,
blocking: typing.Optional[bool] = OMIT,
configured_props: typing.Optional[ConfiguredProps] = OMIT,
configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
dynamic_props_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> ReloadPropsResponse:
Expand All @@ -232,7 +232,8 @@ def reload_props(
blocking : typing.Optional[bool]
Whether this operation should block until completion

configured_props : typing.Optional[ConfiguredProps]
configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
The configured properties for the component

dynamic_props_id : typing.Optional[str]
The ID for dynamic props
Expand Down Expand Up @@ -275,7 +276,7 @@ def run(
*,
id: str,
external_user_id: str,
configured_props: typing.Optional[ConfiguredProps] = OMIT,
configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
dynamic_props_id: typing.Optional[str] = OMIT,
stash_id: typing.Optional[RunActionOptsStashId] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
Expand All @@ -291,7 +292,8 @@ def run(
external_user_id : str
The external user ID

configured_props : typing.Optional[ConfiguredProps]
configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
The configured properties for the action

dynamic_props_id : typing.Optional[str]
The ID for dynamic props
Expand Down Expand Up @@ -466,7 +468,7 @@ async def configure_prop(
external_user_id: str,
prop_name: str,
blocking: typing.Optional[bool] = OMIT,
configured_props: typing.Optional[ConfiguredProps] = OMIT,
configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
dynamic_props_id: typing.Optional[str] = OMIT,
page: typing.Optional[float] = OMIT,
prev_context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
Expand All @@ -490,7 +492,8 @@ async def configure_prop(
blocking : typing.Optional[bool]
Whether this operation should block until completion

configured_props : typing.Optional[ConfiguredProps]
configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
The configured properties for the component

dynamic_props_id : typing.Optional[str]
The ID for dynamic props
Expand Down Expand Up @@ -556,7 +559,7 @@ async def reload_props(
id: str,
external_user_id: str,
blocking: typing.Optional[bool] = OMIT,
configured_props: typing.Optional[ConfiguredProps] = OMIT,
configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
dynamic_props_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> ReloadPropsResponse:
Expand All @@ -574,7 +577,8 @@ async def reload_props(
blocking : typing.Optional[bool]
Whether this operation should block until completion

configured_props : typing.Optional[ConfiguredProps]
configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
The configured properties for the component

dynamic_props_id : typing.Optional[str]
The ID for dynamic props
Expand Down Expand Up @@ -625,7 +629,7 @@ async def run(
*,
id: str,
external_user_id: str,
configured_props: typing.Optional[ConfiguredProps] = OMIT,
configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
dynamic_props_id: typing.Optional[str] = OMIT,
stash_id: typing.Optional[RunActionOptsStashId] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
Expand All @@ -641,7 +645,8 @@ async def run(
external_user_id : str
The external user ID

configured_props : typing.Optional[ConfiguredProps]
configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
The configured properties for the action

dynamic_props_id : typing.Optional[str]
The ID for dynamic props
Expand Down
Loading
Loading