Skip to content

Commit 5cca5d2

Browse files
committed
restore default tiers
1 parent 0ad2c46 commit 5cca5d2

28 files changed

+176
-176
lines changed

src/apify_client/_consts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
DEFAULT_TIMEOUT_MEDIUM = timedelta(seconds=30)
1717
"""Default timeout for batch, list, and data transfer operations."""
1818

19-
DEFAULT_TIMEOUT_LONG = timedelta(seconds=300)
19+
DEFAULT_TIMEOUT_LONG = timedelta(seconds=360)
2020
"""Default timeout for long-polling, streaming, and other heavy operations."""
2121

22-
DEFAULT_TIMEOUT_MAX = timedelta(seconds=600)
22+
DEFAULT_TIMEOUT_MAX = timedelta(seconds=360)
2323
"""Default maximum timeout cap for individual API requests (limits exponential growth)."""
2424

2525
DEFAULT_MAX_RETRIES = 4

src/apify_client/_resource_clients/_resource_client.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def __init__(
193193
params=params,
194194
)
195195

196-
def _get(self, *, timeout: Timeout = 'short') -> dict | None:
196+
def _get(self, *, timeout: Timeout = 'long') -> dict | None:
197197
"""Perform a GET request for this resource, returning the parsed response or None if not found."""
198198
try:
199199
response = self._http_client.call(
@@ -207,7 +207,7 @@ def _get(self, *, timeout: Timeout = 'short') -> dict | None:
207207
catch_not_found_or_throw(exc)
208208
return None
209209

210-
def _update(self, *, timeout: Timeout = 'short', **kwargs: Any) -> dict:
210+
def _update(self, *, timeout: Timeout = 'long', **kwargs: Any) -> dict:
211211
"""Perform a PUT request to update this resource with the given fields."""
212212
response = self._http_client.call(
213213
url=self._build_url(),
@@ -218,7 +218,7 @@ def _update(self, *, timeout: Timeout = 'short', **kwargs: Any) -> dict:
218218
)
219219
return response_to_dict(response)
220220

221-
def _delete(self, *, timeout: Timeout = 'short') -> None:
221+
def _delete(self, *, timeout: Timeout = 'long') -> None:
222222
"""Perform a DELETE request to delete this resource, ignoring 404 errors."""
223223
try:
224224
self._http_client.call(
@@ -230,7 +230,7 @@ def _delete(self, *, timeout: Timeout = 'short') -> None:
230230
except ApifyApiError as exc:
231231
catch_not_found_or_throw(exc)
232232

233-
def _list(self, *, timeout: Timeout = 'medium', **kwargs: Any) -> dict:
233+
def _list(self, *, timeout: Timeout = 'long', **kwargs: Any) -> dict:
234234
"""Perform a GET request to list resources."""
235235
response = self._http_client.call(
236236
url=self._build_url(),
@@ -240,7 +240,7 @@ def _list(self, *, timeout: Timeout = 'medium', **kwargs: Any) -> dict:
240240
)
241241
return response_to_dict(response)
242242

243-
def _create(self, *, timeout: Timeout = 'medium', **kwargs: Any) -> dict:
243+
def _create(self, *, timeout: Timeout = 'long', **kwargs: Any) -> dict:
244244
"""Perform a POST request to create a resource."""
245245
response = self._http_client.call(
246246
url=self._build_url(),
@@ -256,7 +256,7 @@ def _get_or_create(
256256
*,
257257
name: str | None = None,
258258
resource_fields: dict | None = None,
259-
timeout: Timeout = 'medium',
259+
timeout: Timeout = 'long',
260260
) -> dict:
261261
"""Perform a POST request to get or create a named resource."""
262262
response = self._http_client.call(
@@ -372,7 +372,7 @@ def __init__(
372372
params=params,
373373
)
374374

375-
async def _get(self, *, timeout: Timeout = 'short') -> dict | None:
375+
async def _get(self, *, timeout: Timeout = 'long') -> dict | None:
376376
"""Perform a GET request for this resource, returning the parsed response or None if not found."""
377377
try:
378378
response = await self._http_client.call(
@@ -386,7 +386,7 @@ async def _get(self, *, timeout: Timeout = 'short') -> dict | None:
386386
catch_not_found_or_throw(exc)
387387
return None
388388

389-
async def _update(self, *, timeout: Timeout = 'short', **kwargs: Any) -> dict:
389+
async def _update(self, *, timeout: Timeout = 'long', **kwargs: Any) -> dict:
390390
"""Perform a PUT request to update this resource with the given fields."""
391391
response = await self._http_client.call(
392392
url=self._build_url(),
@@ -397,7 +397,7 @@ async def _update(self, *, timeout: Timeout = 'short', **kwargs: Any) -> dict:
397397
)
398398
return response_to_dict(response)
399399

400-
async def _delete(self, *, timeout: Timeout = 'short') -> None:
400+
async def _delete(self, *, timeout: Timeout = 'long') -> None:
401401
"""Perform a DELETE request to delete this resource, ignoring 404 errors."""
402402
try:
403403
await self._http_client.call(
@@ -409,7 +409,7 @@ async def _delete(self, *, timeout: Timeout = 'short') -> None:
409409
except ApifyApiError as exc:
410410
catch_not_found_or_throw(exc)
411411

412-
async def _list(self, *, timeout: Timeout = 'medium', **kwargs: Any) -> dict:
412+
async def _list(self, *, timeout: Timeout = 'long', **kwargs: Any) -> dict:
413413
"""Perform a GET request to list resources."""
414414
response = await self._http_client.call(
415415
url=self._build_url(),
@@ -419,7 +419,7 @@ async def _list(self, *, timeout: Timeout = 'medium', **kwargs: Any) -> dict:
419419
)
420420
return response_to_dict(response)
421421

422-
async def _create(self, *, timeout: Timeout = 'medium', **kwargs: Any) -> dict:
422+
async def _create(self, *, timeout: Timeout = 'long', **kwargs: Any) -> dict:
423423
"""Perform a POST request to create a resource."""
424424
response = await self._http_client.call(
425425
url=self._build_url(),
@@ -435,7 +435,7 @@ async def _get_or_create(
435435
*,
436436
name: str | None = None,
437437
resource_fields: dict | None = None,
438-
timeout: Timeout = 'medium',
438+
timeout: Timeout = 'long',
439439
) -> dict:
440440
"""Perform a POST request to get or create a named resource."""
441441
response = await self._http_client.call(

src/apify_client/_resource_clients/actor.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def __init__(
8585
**kwargs,
8686
)
8787

88-
def get(self, *, timeout: Timeout = 'short') -> Actor | None:
88+
def get(self, *, timeout: Timeout = 'long') -> Actor | None:
8989
"""Retrieve the Actor.
9090
9191
https://docs.apify.com/api/v2#/reference/actors/actor-object/get-actor
@@ -129,7 +129,7 @@ def update(
129129
pricing_infos: list[dict[str, Any]] | None = None,
130130
actor_permission_level: ActorPermissionLevel | None = None,
131131
tagged_builds: dict[str, None | dict[str, str]] | None = None,
132-
timeout: Timeout = 'short',
132+
timeout: Timeout = 'long',
133133
) -> Actor:
134134
"""Update the Actor with the specified fields.
135135
@@ -209,7 +209,7 @@ def update(
209209
result = self._update(timeout=timeout, **actor_fields.model_dump(by_alias=True, exclude_none=True))
210210
return ActorResponse.model_validate(result).data
211211

212-
def delete(self, *, timeout: Timeout = 'short') -> None:
212+
def delete(self, *, timeout: Timeout = 'long') -> None:
213213
"""Delete the Actor.
214214
215215
https://docs.apify.com/api/v2#/reference/actors/actor-object/delete-actor
@@ -233,7 +233,7 @@ def start(
233233
force_permission_level: ActorPermissionLevel | None = None,
234234
wait_for_finish: int | None = None,
235235
webhooks: list[dict] | None = None,
236-
timeout: Timeout = 'short',
236+
timeout: Timeout = 'long',
237237
) -> Run:
238238
"""Start the Actor and immediately return the Run object.
239239
@@ -310,7 +310,7 @@ def call(
310310
force_permission_level: ActorPermissionLevel | None = None,
311311
wait_duration: timedelta | None = None,
312312
logger: Logger | None | Literal['default'] = 'default',
313-
timeout: Timeout = 'short',
313+
timeout: Timeout = 'long',
314314
) -> Run | None:
315315
"""Start the Actor and wait for it to finish before returning the Run object.
316316
@@ -386,7 +386,7 @@ def build(
386386
tag: str | None = None,
387387
use_cache: bool | None = None,
388388
wait_for_finish: int | None = None,
389-
timeout: Timeout = 'short',
389+
timeout: Timeout = 'long',
390390
) -> Build:
391391
"""Build the Actor.
392392
@@ -444,7 +444,7 @@ def default_build(
444444
self,
445445
*,
446446
wait_for_finish: int | None = None,
447-
timeout: Timeout = 'short',
447+
timeout: Timeout = 'long',
448448
) -> BuildClient:
449449
"""Retrieve Actor's default build.
450450
@@ -533,7 +533,7 @@ def validate_input(
533533
*,
534534
build_tag: str | None = None,
535535
content_type: str | None = None,
536-
timeout: Timeout = 'medium',
536+
timeout: Timeout = 'long',
537537
) -> bool:
538538
"""Validate an input for the Actor that defines an input schema.
539539
@@ -581,7 +581,7 @@ def __init__(
581581
**kwargs,
582582
)
583583

584-
async def get(self, *, timeout: Timeout = 'short') -> Actor | None:
584+
async def get(self, *, timeout: Timeout = 'long') -> Actor | None:
585585
"""Retrieve the Actor.
586586
587587
https://docs.apify.com/api/v2#/reference/actors/actor-object/get-actor
@@ -625,7 +625,7 @@ async def update(
625625
pricing_infos: list[dict[str, Any]] | None = None,
626626
actor_permission_level: ActorPermissionLevel | None = None,
627627
tagged_builds: dict[str, None | dict[str, str]] | None = None,
628-
timeout: Timeout = 'short',
628+
timeout: Timeout = 'long',
629629
) -> Actor:
630630
"""Update the Actor with the specified fields.
631631
@@ -705,7 +705,7 @@ async def update(
705705
result = await self._update(timeout=timeout, **actor_fields.model_dump(by_alias=True, exclude_none=True))
706706
return ActorResponse.model_validate(result).data
707707

708-
async def delete(self, *, timeout: Timeout = 'short') -> None:
708+
async def delete(self, *, timeout: Timeout = 'long') -> None:
709709
"""Delete the Actor.
710710
711711
https://docs.apify.com/api/v2#/reference/actors/actor-object/delete-actor
@@ -729,7 +729,7 @@ async def start(
729729
force_permission_level: ActorPermissionLevel | None = None,
730730
wait_for_finish: int | None = None,
731731
webhooks: list[dict] | None = None,
732-
timeout: Timeout = 'short',
732+
timeout: Timeout = 'long',
733733
) -> Run:
734734
"""Start the Actor and immediately return the Run object.
735735
@@ -806,7 +806,7 @@ async def call(
806806
force_permission_level: ActorPermissionLevel | None = None,
807807
wait_duration: timedelta | None = None,
808808
logger: Logger | None | Literal['default'] = 'default',
809-
timeout: Timeout = 'short',
809+
timeout: Timeout = 'long',
810810
) -> Run | None:
811811
"""Start the Actor and wait for it to finish before returning the Run object.
812812
@@ -886,7 +886,7 @@ async def build(
886886
tag: str | None = None,
887887
use_cache: bool | None = None,
888888
wait_for_finish: int | None = None,
889-
timeout: Timeout = 'short',
889+
timeout: Timeout = 'long',
890890
) -> Build:
891891
"""Build the Actor.
892892
@@ -944,7 +944,7 @@ async def default_build(
944944
self,
945945
*,
946946
wait_for_finish: int | None = None,
947-
timeout: Timeout = 'short',
947+
timeout: Timeout = 'long',
948948
) -> BuildClientAsync:
949949
"""Retrieve Actor's default build.
950950
@@ -1033,7 +1033,7 @@ async def validate_input(
10331033
*,
10341034
build_tag: str | None = None,
10351035
content_type: str | None = None,
1036-
timeout: Timeout = 'medium',
1036+
timeout: Timeout = 'long',
10371037
) -> bool:
10381038
"""Validate an input for the Actor that defines an input schema.
10391039

src/apify_client/_resource_clients/actor_collection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def list(
4949
offset: int | None = None,
5050
desc: bool | None = None,
5151
sort_by: Literal['createdAt', 'stats.lastRunStartedAt'] | None = 'createdAt',
52-
timeout: Timeout = 'medium',
52+
timeout: Timeout = 'long',
5353
) -> ListOfActors:
5454
"""List the Actors the user has created or used.
5555
@@ -94,7 +94,7 @@ def create(
9494
actor_standby_idle_timeout: timedelta | None = None,
9595
actor_standby_build: str | None = None,
9696
actor_standby_memory_mbytes: int | None = None,
97-
timeout: Timeout = 'medium',
97+
timeout: Timeout = 'long',
9898
) -> Actor:
9999
"""Create a new Actor.
100100
@@ -194,7 +194,7 @@ async def list(
194194
offset: int | None = None,
195195
desc: bool | None = None,
196196
sort_by: Literal['createdAt', 'stats.lastRunStartedAt'] | None = 'createdAt',
197-
timeout: Timeout = 'medium',
197+
timeout: Timeout = 'long',
198198
) -> ListOfActors:
199199
"""List the Actors the user has created or used.
200200
@@ -239,7 +239,7 @@ async def create(
239239
actor_standby_idle_timeout: timedelta | None = None,
240240
actor_standby_build: str | None = None,
241241
actor_standby_memory_mbytes: int | None = None,
242-
timeout: Timeout = 'medium',
242+
timeout: Timeout = 'long',
243243
) -> Actor:
244244
"""Create a new Actor.
245245

src/apify_client/_resource_clients/actor_env_var.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(
3131
**kwargs,
3232
)
3333

34-
def get(self, *, timeout: Timeout = 'short') -> EnvVar | None:
34+
def get(self, *, timeout: Timeout = 'long') -> EnvVar | None:
3535
"""Return information about the Actor environment variable.
3636
3737
https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/get-environment-variable
@@ -53,7 +53,7 @@ def update(
5353
is_secret: bool | None = None,
5454
name: str,
5555
value: str,
56-
timeout: Timeout = 'short',
56+
timeout: Timeout = 'long',
5757
) -> EnvVar:
5858
"""Update the Actor environment variable with specified fields.
5959
@@ -74,7 +74,7 @@ def update(
7474
)
7575
return EnvVarResponse.model_validate(result).data
7676

77-
def delete(self, *, timeout: Timeout = 'short') -> None:
77+
def delete(self, *, timeout: Timeout = 'long') -> None:
7878
"""Delete the Actor environment variable.
7979
8080
https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/delete-environment-variable
@@ -106,7 +106,7 @@ def __init__(
106106
**kwargs,
107107
)
108108

109-
async def get(self, *, timeout: Timeout = 'short') -> EnvVar | None:
109+
async def get(self, *, timeout: Timeout = 'long') -> EnvVar | None:
110110
"""Return information about the Actor environment variable.
111111
112112
https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/get-environment-variable
@@ -128,7 +128,7 @@ async def update(
128128
is_secret: bool | None = None,
129129
name: str,
130130
value: str,
131-
timeout: Timeout = 'short',
131+
timeout: Timeout = 'long',
132132
) -> EnvVar:
133133
"""Update the Actor environment variable with specified fields.
134134
@@ -149,7 +149,7 @@ async def update(
149149
)
150150
return EnvVarResponse.model_validate(result).data
151151

152-
async def delete(self, *, timeout: Timeout = 'short') -> None:
152+
async def delete(self, *, timeout: Timeout = 'long') -> None:
153153
"""Delete the Actor environment variable.
154154
155155
https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/delete-environment-variable

src/apify_client/_resource_clients/actor_env_var_collection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(
2929
**kwargs,
3030
)
3131

32-
def list(self, *, timeout: Timeout = 'medium') -> ListOfEnvVars:
32+
def list(self, *, timeout: Timeout = 'long') -> ListOfEnvVars:
3333
"""List the available Actor environment variables.
3434
3535
https://docs.apify.com/api/v2#/reference/actors/environment-variable-collection/get-list-of-environment-variables
@@ -49,7 +49,7 @@ def create(
4949
is_secret: bool | None = None,
5050
name: str,
5151
value: str,
52-
timeout: Timeout = 'medium',
52+
timeout: Timeout = 'long',
5353
) -> EnvVar:
5454
"""Create a new Actor environment variable.
5555
@@ -90,7 +90,7 @@ def __init__(
9090
**kwargs,
9191
)
9292

93-
async def list(self, *, timeout: Timeout = 'medium') -> ListOfEnvVars:
93+
async def list(self, *, timeout: Timeout = 'long') -> ListOfEnvVars:
9494
"""List the available Actor environment variables.
9595
9696
https://docs.apify.com/api/v2#/reference/actors/environment-variable-collection/get-list-of-environment-variables
@@ -110,7 +110,7 @@ async def create(
110110
is_secret: bool | None = None,
111111
name: str,
112112
value: str,
113-
timeout: Timeout = 'medium',
113+
timeout: Timeout = 'long',
114114
) -> EnvVar:
115115
"""Create a new Actor environment variable.
116116

0 commit comments

Comments
 (0)