@@ -65,7 +65,9 @@ def create(
6565 account_id : str ,
6666 * ,
6767 url : str ,
68+ customagent : str | NotGiven = NOT_GIVEN ,
6869 custom_headers : Dict [str , str ] | NotGiven = NOT_GIVEN ,
70+ referer : str | NotGiven = NOT_GIVEN ,
6971 screenshots_resolutions : List [Literal ["desktop" , "mobile" , "tablet" ]] | NotGiven = NOT_GIVEN ,
7072 visibility : Literal ["Public" , "Unlisted" ] | NotGiven = NOT_GIVEN ,
7173 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -74,11 +76,10 @@ def create(
7476 extra_query : Query | None = None ,
7577 extra_body : Body | None = None ,
7678 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
77- ) -> ScanCreateResponse :
79+ ) -> str :
7880 """Submit a URL to scan.
7981
80- You can also set some options, like the visibility level
81- and custom headers. Check limits at
82+ Check limits at
8283 https://developers.cloudflare.com/security-center/investigate/scan-limits/.
8384
8485 Args:
@@ -105,11 +106,13 @@ def create(
105106 if not account_id :
106107 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
107108 return self ._post (
108- f"/accounts/{ account_id } /urlscanner/scan" ,
109+ f"/accounts/{ account_id } /urlscanner/v2/ scan" ,
109110 body = maybe_transform (
110111 {
111112 "url" : url ,
113+ "customagent" : customagent ,
112114 "custom_headers" : custom_headers ,
115+ "referer" : referer ,
113116 "screenshots_resolutions" : screenshots_resolutions ,
114117 "visibility" : visibility ,
115118 },
@@ -122,7 +125,7 @@ def create(
122125 timeout = timeout ,
123126 post_parser = ResultWrapper [ScanCreateResponse ]._unwrapper ,
124127 ),
125- cast_to = cast (Type [ScanCreateResponse ], ResultWrapper [ScanCreateResponse ]),
128+ cast_to = cast (Type [str ], ResultWrapper [str ]),
126129 )
127130
128131 def list (
@@ -415,7 +418,9 @@ async def create(
415418 account_id : str ,
416419 * ,
417420 url : str ,
421+ customagent : str | NotGiven = NOT_GIVEN ,
418422 custom_headers : Dict [str , str ] | NotGiven = NOT_GIVEN ,
423+ referer : str | NotGiven = NOT_GIVEN ,
419424 screenshots_resolutions : List [Literal ["desktop" , "mobile" , "tablet" ]] | NotGiven = NOT_GIVEN ,
420425 visibility : Literal ["Public" , "Unlisted" ] | NotGiven = NOT_GIVEN ,
421426 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -424,11 +429,10 @@ async def create(
424429 extra_query : Query | None = None ,
425430 extra_body : Body | None = None ,
426431 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
427- ) -> ScanCreateResponse :
432+ ) -> str :
428433 """Submit a URL to scan.
429434
430- You can also set some options, like the visibility level
431- and custom headers. Check limits at
435+ Check limits at
432436 https://developers.cloudflare.com/security-center/investigate/scan-limits/.
433437
434438 Args:
@@ -455,11 +459,13 @@ async def create(
455459 if not account_id :
456460 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
457461 return await self ._post (
458- f"/accounts/{ account_id } /urlscanner/scan" ,
462+ f"/accounts/{ account_id } /urlscanner/v2/ scan" ,
459463 body = await async_maybe_transform (
460464 {
461465 "url" : url ,
466+ "customagent" : customagent ,
462467 "custom_headers" : custom_headers ,
468+ "referer" : referer ,
463469 "screenshots_resolutions" : screenshots_resolutions ,
464470 "visibility" : visibility ,
465471 },
@@ -472,7 +478,7 @@ async def create(
472478 timeout = timeout ,
473479 post_parser = ResultWrapper [ScanCreateResponse ]._unwrapper ,
474480 ),
475- cast_to = cast (Type [ScanCreateResponse ], ResultWrapper [ScanCreateResponse ]),
481+ cast_to = cast (Type [str ], ResultWrapper [str ]),
476482 )
477483
478484 async def list (
0 commit comments