Skip to content

Commit d22e3b9

Browse files
committed
Reorder Actor.create_proxy_configuration() arguments
1 parent 1abf8c9 commit d22e3b9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

docs/docs.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ Set the status message for the current actor run.
925925

926926
***
927927

928-
#### [](#actor-create_proxy_configuration) `async Actor.create_proxy_configuration(*, password=None, groups=None, country_code=None, proxy_urls=None, new_url_function=None, actor_proxy_input=None)`
928+
#### [](#actor-create_proxy_configuration) `async Actor.create_proxy_configuration(*, actor_proxy_input=None, password=None, groups=None, country_code=None, proxy_urls=None, new_url_function=None)`
929929

930930
Create a ProxyConfiguration object with the passed proxy configuration.
931931

@@ -936,6 +936,9 @@ For more details and code examples, see the ProxyConfiguration class.
936936

937937
* **Parameters**
938938

939+
* **actor_proxy_input** (`dict`, *optional*) – Proxy configuration field from the actor input, if actor has such input field.
940+
If you pass this argument, all the other arguments will be inferred from it.
941+
939942
* **password** (`str`, *optional*) – Password for the Apify Proxy. If not provided, will use os.environ[‘APIFY_PROXY_PASSWORD’], if available.
940943

941944
* **groups** (`list of str`, *optional*) – Proxy groups which the Apify Proxy should use, if provided.
@@ -946,8 +949,6 @@ For more details and code examples, see the ProxyConfiguration class.
946949

947950
* **new_url_function** (`Callable`, *optional*) – Function which returns a custom proxy URL to be used.
948951

949-
* **actor_proxy_input** (`dict`, *optional*) – Proxy configuration field from the actor input, if actor has such input field.
950-
951952
* **Returns**
952953

953954
ProxyConfiguration object with the passed configuration,

src/apify/actor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,12 +1236,12 @@ async def _set_status_message_internal(self, status_message: str) -> Optional[Di
12361236
async def create_proxy_configuration(
12371237
cls,
12381238
*,
1239+
actor_proxy_input: Optional[Dict] = None, # this is the raw proxy input from the actor run input, it is not spread or snake_cased in here
12391240
password: Optional[str] = None,
12401241
groups: Optional[List[str]] = None,
12411242
country_code: Optional[str] = None,
12421243
proxy_urls: Optional[List[str]] = None,
12431244
new_url_function: Optional[Union[Callable[[Optional[str]], str], Callable[[Optional[str]], Awaitable[str]]]] = None,
1244-
actor_proxy_input: Optional[Dict] = None, # this is the raw proxy input from the actor run input, it is not spread or snake_cased in here
12451245
) -> Optional[ProxyConfiguration]:
12461246
"""Create a ProxyConfiguration object with the passed proxy configuration.
12471247
@@ -1251,12 +1251,13 @@ async def create_proxy_configuration(
12511251
For more details and code examples, see the `ProxyConfiguration` class.
12521252
12531253
Args:
1254+
actor_proxy_input (dict, optional): Proxy configuration field from the actor input, if actor has such input field.
1255+
If you pass this argument, all the other arguments will be inferred from it.
12541256
password (str, optional): Password for the Apify Proxy. If not provided, will use os.environ['APIFY_PROXY_PASSWORD'], if available.
12551257
groups (list of str, optional): Proxy groups which the Apify Proxy should use, if provided.
12561258
country_code (str, optional): Country which the Apify Proxy should use, if provided.
12571259
proxy_urls (list of str, optional): Custom proxy server URLs which should be rotated through.
12581260
new_url_function (Callable, optional): Function which returns a custom proxy URL to be used.
1259-
actor_proxy_input (dict, optional): Proxy configuration field from the actor input, if actor has such input field.
12601261
12611262
Returns:
12621263
ProxyConfiguration, optional: ProxyConfiguration object with the passed configuration,
@@ -1274,12 +1275,12 @@ async def create_proxy_configuration(
12741275
async def _create_proxy_configuration_internal(
12751276
self,
12761277
*,
1278+
actor_proxy_input: Optional[Dict] = None, # this is the raw proxy input from the actor run input, it is not spread or snake_cased in here
12771279
password: Optional[str] = None,
12781280
groups: Optional[List[str]] = None,
12791281
country_code: Optional[str] = None,
12801282
proxy_urls: Optional[List[str]] = None,
12811283
new_url_function: Optional[Union[Callable[[Optional[str]], str], Callable[[Optional[str]], Awaitable[str]]]] = None,
1282-
actor_proxy_input: Optional[Dict] = None, # this is the raw proxy input from the actor run input, it is not spread or snake_cased in here
12831284
) -> Optional[ProxyConfiguration]:
12841285
self._raise_if_not_initialized()
12851286

0 commit comments

Comments
 (0)