Skip to content

Commit e79dcf4

Browse files
committed
refactor: move default_run_force_permission_level to #1111
1 parent 1796114 commit e79dcf4

3 files changed

Lines changed: 8 additions & 31 deletions

File tree

‎src/apify_client/_resource_clients/actor.py‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ def update(
119119
default_run_max_items: int | None = None,
120120
default_run_memory_mbytes: int | None = None,
121121
default_run_timeout: timedelta | None = None,
122-
default_run_force_permission_level: ActorPermissionLevel | None = None,
123122
example_run_input_body: Any = None,
124123
example_run_input_content_type: str | None = None,
125124
actor_standby_is_enabled: bool | None = None,
@@ -156,8 +155,6 @@ def update(
156155
by runs of this Actor, if the Actor is charged per result.
157156
default_run_memory_mbytes: Default amount of memory allocated for the runs of this Actor, in megabytes.
158157
default_run_timeout: Default timeout for the runs of this Actor.
159-
default_run_force_permission_level: Permission level to force on the runs of this Actor, overriding the
160-
permission level of the Actor.
161158
example_run_input_body: Input to be prefilled as default input to new users of this Actor.
162159
example_run_input_content_type: The content type of the example run input.
163160
actor_standby_is_enabled: Whether the Actor Standby is enabled.
@@ -200,7 +197,6 @@ def update(
200197
max_items=default_run_max_items,
201198
memory_mbytes=default_run_memory_mbytes,
202199
timeout_secs=to_seconds(default_run_timeout, as_int=True),
203-
force_permission_level=default_run_force_permission_level,
204200
restart_on_error=restart_on_error,
205201
),
206202
actor_standby=ActorStandby(
@@ -665,7 +661,6 @@ async def update(
665661
default_run_max_items: int | None = None,
666662
default_run_memory_mbytes: int | None = None,
667663
default_run_timeout: timedelta | None = None,
668-
default_run_force_permission_level: ActorPermissionLevel | None = None,
669664
example_run_input_body: Any = None,
670665
example_run_input_content_type: str | None = None,
671666
actor_standby_is_enabled: bool | None = None,
@@ -702,8 +697,6 @@ async def update(
702697
by runs of this Actor, if the Actor is charged per result.
703698
default_run_memory_mbytes: Default amount of memory allocated for the runs of this Actor, in megabytes.
704699
default_run_timeout: Default timeout for the runs of this Actor.
705-
default_run_force_permission_level: Permission level to force on the runs of this Actor, overriding the
706-
permission level of the Actor.
707700
example_run_input_body: Input to be prefilled as default input to new users of this Actor.
708701
example_run_input_content_type: The content type of the example run input.
709702
actor_standby_is_enabled: Whether the Actor Standby is enabled.
@@ -746,7 +739,6 @@ async def update(
746739
max_items=default_run_max_items,
747740
memory_mbytes=default_run_memory_mbytes,
748741
timeout_secs=to_seconds(default_run_timeout, as_int=True),
749-
force_permission_level=default_run_force_permission_level,
750742
restart_on_error=restart_on_error,
751743
),
752744
actor_standby=ActorStandby(

‎src/apify_client/_resource_clients/actor_collection.py‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from collections.abc import AsyncIterator, Iterator
2222
from datetime import timedelta
2323

24-
from apify_client._literals import ActorPermissionLevel
2524
from apify_client._models import ActorShort
2625
from apify_client.types import Timeout
2726

@@ -124,7 +123,6 @@ def create(
124123
default_run_max_items: int | None = None,
125124
default_run_memory_mbytes: int | None = None,
126125
default_run_timeout: timedelta | None = None,
127-
default_run_force_permission_level: ActorPermissionLevel | None = None,
128126
example_run_input_body: Any = None,
129127
example_run_input_content_type: str | None = None,
130128
actor_standby_is_enabled: bool | None = None,
@@ -158,8 +156,6 @@ def create(
158156
of this Actor, if the Actor is charged per result.
159157
default_run_memory_mbytes: Default amount of memory allocated for the runs of this Actor, in megabytes.
160158
default_run_timeout: Default timeout for the runs of this Actor.
161-
default_run_force_permission_level: Permission level to force on the runs of this Actor, overriding the
162-
permission level of the Actor.
163159
example_run_input_body: Input to be prefilled as default input to new users of this Actor.
164160
example_run_input_content_type: The content type of the example run input.
165161
actor_standby_is_enabled: Whether the Actor Standby is enabled.
@@ -195,7 +191,6 @@ def create(
195191
max_items=default_run_max_items,
196192
memory_mbytes=default_run_memory_mbytes,
197193
timeout_secs=to_seconds(default_run_timeout, as_int=True),
198-
force_permission_level=default_run_force_permission_level,
199194
restart_on_error=restart_on_error,
200195
),
201196
actor_standby=ActorStandby(
@@ -315,7 +310,6 @@ async def create(
315310
default_run_max_items: int | None = None,
316311
default_run_memory_mbytes: int | None = None,
317312
default_run_timeout: timedelta | None = None,
318-
default_run_force_permission_level: ActorPermissionLevel | None = None,
319313
example_run_input_body: Any = None,
320314
example_run_input_content_type: str | None = None,
321315
actor_standby_is_enabled: bool | None = None,
@@ -349,8 +343,6 @@ async def create(
349343
of this Actor, if the Actor is charged per result.
350344
default_run_memory_mbytes: Default amount of memory allocated for the runs of this Actor, in megabytes.
351345
default_run_timeout: Default timeout for the runs of this Actor.
352-
default_run_force_permission_level: Permission level to force on the runs of this Actor, overriding the
353-
permission level of the Actor.
354346
example_run_input_body: Input to be prefilled as default input to new users of this Actor.
355347
example_run_input_content_type: The content type of the example run input.
356348
actor_standby_is_enabled: Whether the Actor Standby is enabled.
@@ -386,7 +378,6 @@ async def create(
386378
max_items=default_run_max_items,
387379
memory_mbytes=default_run_memory_mbytes,
388380
timeout_secs=to_seconds(default_run_timeout, as_int=True),
389-
force_permission_level=default_run_force_permission_level,
390381
restart_on_error=restart_on_error,
391382
),
392383
actor_standby=ActorStandby(

‎tests/unit/test_actor_update_fields.py‎

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,11 @@
3535
}
3636

3737
_FIELDS: dict[str, Any] = {
38-
'default_run_force_permission_level': 'FULL_PERMISSIONS',
3938
'actor_standby_disable_standby_fields_override': True,
4039
'actor_standby_should_pass_actor_input': False,
4140
}
4241

4342
_EXPECTED_BODY = {
44-
'defaultRunOptions': {'forcePermissionLevel': 'FULL_PERMISSIONS'},
4543
'actorStandby': {'disableStandbyFieldsOverride': True, 'shouldPassActorInput': False},
4644
}
4745

@@ -59,8 +57,8 @@ def body_subset(request: Request) -> dict[str, Any]:
5957
return {key: body[key] for key in _EXPECTED_BODY}
6058

6159

62-
def test_update_sends_permission_and_standby_fields(httpserver: HTTPServer, sync_client: ApifyClient) -> None:
63-
"""`update` nests the forced permission level and the Standby flags into the request body."""
60+
def test_update_sends_standby_fields(httpserver: HTTPServer, sync_client: ApifyClient) -> None:
61+
"""`update` nests the Standby flags into `actorStandby`."""
6462
captured: list[Request] = []
6563
httpserver.expect_request(_ACTOR_PATH, method='PUT').respond_with_handler(capture(captured))
6664

@@ -70,10 +68,8 @@ def test_update_sends_permission_and_standby_fields(httpserver: HTTPServer, sync
7068
assert body_subset(captured[0]) == _EXPECTED_BODY
7169

7270

73-
async def test_update_sends_permission_and_standby_fields_async(
74-
httpserver: HTTPServer, async_client: ApifyClientAsync
75-
) -> None:
76-
"""Async `update` nests the forced permission level and the Standby flags into the request body."""
71+
async def test_update_sends_standby_fields_async(httpserver: HTTPServer, async_client: ApifyClientAsync) -> None:
72+
"""Async `update` nests the Standby flags into `actorStandby`."""
7773
captured: list[Request] = []
7874
httpserver.expect_request(_ACTOR_PATH, method='PUT').respond_with_handler(capture(captured))
7975

@@ -83,8 +79,8 @@ async def test_update_sends_permission_and_standby_fields_async(
8379
assert body_subset(captured[0]) == _EXPECTED_BODY
8480

8581

86-
def test_create_sends_permission_and_standby_fields(httpserver: HTTPServer, sync_client: ApifyClient) -> None:
87-
"""`create` nests the forced permission level and the Standby flags into the request body."""
82+
def test_create_sends_standby_fields(httpserver: HTTPServer, sync_client: ApifyClient) -> None:
83+
"""`create` nests the Standby flags into `actorStandby`."""
8884
captured: list[Request] = []
8985
httpserver.expect_request(_ACTORS_PATH, method='POST').respond_with_handler(capture(captured))
9086

@@ -94,10 +90,8 @@ def test_create_sends_permission_and_standby_fields(httpserver: HTTPServer, sync
9490
assert body_subset(captured[0]) == _EXPECTED_BODY
9591

9692

97-
async def test_create_sends_permission_and_standby_fields_async(
98-
httpserver: HTTPServer, async_client: ApifyClientAsync
99-
) -> None:
100-
"""Async `create` nests the forced permission level and the Standby flags into the request body."""
93+
async def test_create_sends_standby_fields_async(httpserver: HTTPServer, async_client: ApifyClientAsync) -> None:
94+
"""Async `create` nests the Standby flags into `actorStandby`."""
10195
captured: list[Request] = []
10296
httpserver.expect_request(_ACTORS_PATH, method='POST').respond_with_handler(capture(captured))
10397

0 commit comments

Comments
 (0)