From d96fe7f3675d33774b856f8997177ad56e194b61 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 19:17:16 +0000 Subject: [PATCH] feat: OpenAPI spec update via Stainless API (#124) --- .../resources/url_scanner/url_scanner.py | 26 +++++++++++++++++++ .../types/url_scanner_scan_params.py | 12 +++++++++ tests/api_resources/test_url_scanner.py | 6 +++++ 3 files changed, 44 insertions(+) diff --git a/src/cloudflare/resources/url_scanner/url_scanner.py b/src/cloudflare/resources/url_scanner/url_scanner.py index 353fd03c8..b93ed2fa4 100644 --- a/src/cloudflare/resources/url_scanner/url_scanner.py +++ b/src/cloudflare/resources/url_scanner/url_scanner.py @@ -55,12 +55,15 @@ class URLScanner(SyncAPIResource): account_id: str, *, account_scans: bool | NotGiven = NOT_GIVEN, + asn: str | NotGiven = NOT_GIVEN, date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, hostname: str | NotGiven = NOT_GIVEN, ip: str | NotGiven = NOT_GIVEN, + is_malicious: bool | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, next_cursor: str | NotGiven = NOT_GIVEN, + page_asn: str | NotGiven = NOT_GIVEN, page_hostname: str | NotGiven = NOT_GIVEN, page_ip: str | NotGiven = NOT_GIVEN, page_path: str | NotGiven = NOT_GIVEN, @@ -88,6 +91,9 @@ class URLScanner(SyncAPIResource): account_scans: Return only scans created by account. + asn: Filter scans by Autonomous System Number (ASN) of _any_ request made by the + webpage. + date_end: Filter scans requested before date (inclusive). date_start: Filter scans requested after date (inclusive). @@ -96,10 +102,14 @@ class URLScanner(SyncAPIResource): ip: Filter scans by IP address (IPv4 or IPv6) of _any_ request made by the webpage. + is_malicious: Filter scans by malicious verdict. + limit: Limit the number of objects in the response. next_cursor: Pagination cursor to get the next set of results. + page_asn: Filter scans by main page Autonomous System Number (ASN). + page_hostname: Filter scans by main page hostname . page_ip: Filter scans by main page IP address (IPv4 or IPv6). @@ -134,12 +144,15 @@ class URLScanner(SyncAPIResource): query=maybe_transform( { "account_scans": account_scans, + "asn": asn, "date_end": date_end, "date_start": date_start, "hostname": hostname, "ip": ip, + "is_malicious": is_malicious, "limit": limit, "next_cursor": next_cursor, + "page_asn": page_asn, "page_hostname": page_hostname, "page_ip": page_ip, "page_path": page_path, @@ -174,12 +187,15 @@ class AsyncURLScanner(AsyncAPIResource): account_id: str, *, account_scans: bool | NotGiven = NOT_GIVEN, + asn: str | NotGiven = NOT_GIVEN, date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, hostname: str | NotGiven = NOT_GIVEN, ip: str | NotGiven = NOT_GIVEN, + is_malicious: bool | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, next_cursor: str | NotGiven = NOT_GIVEN, + page_asn: str | NotGiven = NOT_GIVEN, page_hostname: str | NotGiven = NOT_GIVEN, page_ip: str | NotGiven = NOT_GIVEN, page_path: str | NotGiven = NOT_GIVEN, @@ -207,6 +223,9 @@ class AsyncURLScanner(AsyncAPIResource): account_scans: Return only scans created by account. + asn: Filter scans by Autonomous System Number (ASN) of _any_ request made by the + webpage. + date_end: Filter scans requested before date (inclusive). date_start: Filter scans requested after date (inclusive). @@ -215,10 +234,14 @@ class AsyncURLScanner(AsyncAPIResource): ip: Filter scans by IP address (IPv4 or IPv6) of _any_ request made by the webpage. + is_malicious: Filter scans by malicious verdict. + limit: Limit the number of objects in the response. next_cursor: Pagination cursor to get the next set of results. + page_asn: Filter scans by main page Autonomous System Number (ASN). + page_hostname: Filter scans by main page hostname . page_ip: Filter scans by main page IP address (IPv4 or IPv6). @@ -253,12 +276,15 @@ class AsyncURLScanner(AsyncAPIResource): query=await async_maybe_transform( { "account_scans": account_scans, + "asn": asn, "date_end": date_end, "date_start": date_start, "hostname": hostname, "ip": ip, + "is_malicious": is_malicious, "limit": limit, "next_cursor": next_cursor, + "page_asn": page_asn, "page_hostname": page_hostname, "page_ip": page_ip, "page_path": page_path, diff --git a/src/cloudflare/types/url_scanner_scan_params.py b/src/cloudflare/types/url_scanner_scan_params.py index 0233f6572..d50a31842 100644 --- a/src/cloudflare/types/url_scanner_scan_params.py +++ b/src/cloudflare/types/url_scanner_scan_params.py @@ -15,6 +15,12 @@ class URLScannerScanParams(TypedDict, total=False): account_scans: bool """Return only scans created by account.""" + asn: str + """ + Filter scans by Autonomous System Number (ASN) of _any_ request made by the + webpage. + """ + date_end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] """Filter scans requested before date (inclusive).""" @@ -27,12 +33,18 @@ class URLScannerScanParams(TypedDict, total=False): ip: str """Filter scans by IP address (IPv4 or IPv6) of _any_ request made by the webpage.""" + is_malicious: bool + """Filter scans by malicious verdict.""" + limit: int """Limit the number of objects in the response.""" next_cursor: str """Pagination cursor to get the next set of results.""" + page_asn: str + """Filter scans by main page Autonomous System Number (ASN).""" + page_hostname: str """Filter scans by main page hostname .""" diff --git a/tests/api_resources/test_url_scanner.py b/tests/api_resources/test_url_scanner.py index 50bc79636..60d65e178 100644 --- a/tests/api_resources/test_url_scanner.py +++ b/tests/api_resources/test_url_scanner.py @@ -32,12 +32,15 @@ class TestURLScanner: url_scanner = client.url_scanner.scan( "string", account_scans=True, + asn="13335", date_end=parse_datetime("2019-12-27T18:11:19.117Z"), date_start=parse_datetime("2019-12-27T18:11:19.117Z"), hostname="example.com", ip="1.1.1.1", + is_malicious=True, limit=100, next_cursor="string", + page_asn="string", page_hostname="string", page_ip="string", page_path="string", @@ -100,12 +103,15 @@ class TestAsyncURLScanner: url_scanner = await async_client.url_scanner.scan( "string", account_scans=True, + asn="13335", date_end=parse_datetime("2019-12-27T18:11:19.117Z"), date_start=parse_datetime("2019-12-27T18:11:19.117Z"), hostname="example.com", ip="1.1.1.1", + is_malicious=True, limit=100, next_cursor="string", + page_asn="string", page_hostname="string", page_ip="string", page_path="string",