mirror of
https://github.com/cloudflare/cloudflare-python.git
synced 2026-01-16 23:01:03 +00:00
feat(api): api update
This commit is contained in:
parent
5b6e8e6693
commit
730a028452
4 changed files with 32 additions and 20 deletions
|
|
@ -1,4 +1,4 @@
|
|||
configured_endpoints: 1741
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-565c8d95123e68824d8f87eb6729d5bff98e8d236c813fea0fbf0b0b92bc3815.yml
|
||||
openapi_spec_hash: c64c0533ddd197589cdee29328c933b4
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4f09536481c9c0a4787d1ca16e6abf17da7eab89d2c7d2d0d9def51cc5bb6d76.yml
|
||||
openapi_spec_hash: 63f3bfe2f416defc47924e120dd89266
|
||||
config_hash: 2782b93d61eb52118b969d0541d46a01
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
|
|
@ -48,7 +50,8 @@ class SearchesResource(SyncAPIResource):
|
|||
account_id: str,
|
||||
page: float | NotGiven = NOT_GIVEN,
|
||||
per_page: float | NotGiven = NOT_GIVEN,
|
||||
search_params: search_list_params.SearchParams | NotGiven = NOT_GIVEN,
|
||||
query: str | NotGiven = NOT_GIVEN,
|
||||
references: Literal["", "*", "referral", "referrer"] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
|
|
@ -62,6 +65,11 @@ class SearchesResource(SyncAPIResource):
|
|||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
query: Search query term.
|
||||
|
||||
references: The type of references to include. "\\**" to include both referral and referrer
|
||||
references. "" to not include any reference information.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -84,7 +92,8 @@ class SearchesResource(SyncAPIResource):
|
|||
{
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
"search_params": search_params,
|
||||
"query": query,
|
||||
"references": references,
|
||||
},
|
||||
search_list_params.SearchListParams,
|
||||
),
|
||||
|
|
@ -119,7 +128,8 @@ class AsyncSearchesResource(AsyncAPIResource):
|
|||
account_id: str,
|
||||
page: float | NotGiven = NOT_GIVEN,
|
||||
per_page: float | NotGiven = NOT_GIVEN,
|
||||
search_params: search_list_params.SearchParams | NotGiven = NOT_GIVEN,
|
||||
query: str | NotGiven = NOT_GIVEN,
|
||||
references: Literal["", "*", "referral", "referrer"] | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
|
|
@ -133,6 +143,11 @@ class AsyncSearchesResource(AsyncAPIResource):
|
|||
Args:
|
||||
account_id: Identifier
|
||||
|
||||
query: Search query term.
|
||||
|
||||
references: The type of references to include. "\\**" to include both referral and referrer
|
||||
references. "" to not include any reference information.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
|
@ -155,7 +170,8 @@ class AsyncSearchesResource(AsyncAPIResource):
|
|||
{
|
||||
"page": page,
|
||||
"per_page": per_page,
|
||||
"search_params": search_params,
|
||||
"query": query,
|
||||
"references": references,
|
||||
},
|
||||
search_list_params.SearchListParams,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["SearchListParams", "SearchParams"]
|
||||
__all__ = ["SearchListParams"]
|
||||
|
||||
|
||||
class SearchListParams(TypedDict, total=False):
|
||||
|
|
@ -15,12 +15,12 @@ class SearchListParams(TypedDict, total=False):
|
|||
|
||||
per_page: float
|
||||
|
||||
search_params: SearchParams
|
||||
|
||||
|
||||
class SearchParams(TypedDict, total=False):
|
||||
query: str
|
||||
"""Search query term."""
|
||||
|
||||
references: Literal["", "*", "referral", "referrer"]
|
||||
"""The type of references to include ("\\**" for all)."""
|
||||
"""The type of references to include.
|
||||
|
||||
"\\**" to include both referral and referrer references. "" to not include any
|
||||
reference information.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -33,10 +33,8 @@ class TestSearches:
|
|||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
page=1,
|
||||
per_page=1,
|
||||
search_params={
|
||||
"query": "primary",
|
||||
"references": "*",
|
||||
},
|
||||
query="primary",
|
||||
references="*",
|
||||
)
|
||||
assert_matches_type(SyncV4PagePagination[SearchListResponse], search, path=["response"])
|
||||
|
||||
|
|
@ -93,10 +91,8 @@ class TestAsyncSearches:
|
|||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
page=1,
|
||||
per_page=1,
|
||||
search_params={
|
||||
"query": "primary",
|
||||
"references": "*",
|
||||
},
|
||||
query="primary",
|
||||
references="*",
|
||||
)
|
||||
assert_matches_type(AsyncV4PagePagination[SearchListResponse], search, path=["response"])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue