Skip to content

Commit 730a028

Browse files
feat(api): api update
1 parent 5b6e8e6 commit 730a028

File tree

4 files changed

+32
-20
lines changed

4 files changed

+32
-20
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1741
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-565c8d95123e68824d8f87eb6729d5bff98e8d236c813fea0fbf0b0b92bc3815.yml
3-
openapi_spec_hash: c64c0533ddd197589cdee29328c933b4
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4f09536481c9c0a4787d1ca16e6abf17da7eab89d2c7d2d0d9def51cc5bb6d76.yml
3+
openapi_spec_hash: 63f3bfe2f416defc47924e120dd89266
44
config_hash: 2782b93d61eb52118b969d0541d46a01

src/cloudflare/resources/load_balancers/searches.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from __future__ import annotations
44

5+
from typing_extensions import Literal
6+
57
import httpx
68

79
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
@@ -48,7 +50,8 @@ def list(
4850
account_id: str,
4951
page: float | NotGiven = NOT_GIVEN,
5052
per_page: float | NotGiven = NOT_GIVEN,
51-
search_params: search_list_params.SearchParams | NotGiven = NOT_GIVEN,
53+
query: str | NotGiven = NOT_GIVEN,
54+
references: Literal["", "*", "referral", "referrer"] | NotGiven = NOT_GIVEN,
5255
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5356
# The extra values given here take precedence over values defined on the client or passed to this method.
5457
extra_headers: Headers | None = None,
@@ -62,6 +65,11 @@ def list(
6265
Args:
6366
account_id: Identifier
6467
68+
query: Search query term.
69+
70+
references: The type of references to include. "\\**" to include both referral and referrer
71+
references. "" to not include any reference information.
72+
6573
extra_headers: Send extra headers
6674
6775
extra_query: Add additional query parameters to the request
@@ -84,7 +92,8 @@ def list(
8492
{
8593
"page": page,
8694
"per_page": per_page,
87-
"search_params": search_params,
95+
"query": query,
96+
"references": references,
8897
},
8998
search_list_params.SearchListParams,
9099
),
@@ -119,7 +128,8 @@ def list(
119128
account_id: str,
120129
page: float | NotGiven = NOT_GIVEN,
121130
per_page: float | NotGiven = NOT_GIVEN,
122-
search_params: search_list_params.SearchParams | NotGiven = NOT_GIVEN,
131+
query: str | NotGiven = NOT_GIVEN,
132+
references: Literal["", "*", "referral", "referrer"] | NotGiven = NOT_GIVEN,
123133
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
124134
# The extra values given here take precedence over values defined on the client or passed to this method.
125135
extra_headers: Headers | None = None,
@@ -133,6 +143,11 @@ def list(
133143
Args:
134144
account_id: Identifier
135145
146+
query: Search query term.
147+
148+
references: The type of references to include. "\\**" to include both referral and referrer
149+
references. "" to not include any reference information.
150+
136151
extra_headers: Send extra headers
137152
138153
extra_query: Add additional query parameters to the request
@@ -155,7 +170,8 @@ def list(
155170
{
156171
"page": page,
157172
"per_page": per_page,
158-
"search_params": search_params,
173+
"query": query,
174+
"references": references,
159175
},
160176
search_list_params.SearchListParams,
161177
),

src/cloudflare/types/load_balancers/search_list_params.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from typing_extensions import Literal, Required, TypedDict
66

7-
__all__ = ["SearchListParams", "SearchParams"]
7+
__all__ = ["SearchListParams"]
88

99

1010
class SearchListParams(TypedDict, total=False):
@@ -15,12 +15,12 @@ class SearchListParams(TypedDict, total=False):
1515

1616
per_page: float
1717

18-
search_params: SearchParams
19-
20-
21-
class SearchParams(TypedDict, total=False):
2218
query: str
2319
"""Search query term."""
2420

2521
references: Literal["", "*", "referral", "referrer"]
26-
"""The type of references to include ("\\**" for all)."""
22+
"""The type of references to include.
23+
24+
"\\**" to include both referral and referrer references. "" to not include any
25+
reference information.
26+
"""

tests/api_resources/load_balancers/test_searches.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
3333
account_id="023e105f4ecef8ad9ca31a8372d0c353",
3434
page=1,
3535
per_page=1,
36-
search_params={
37-
"query": "primary",
38-
"references": "*",
39-
},
36+
query="primary",
37+
references="*",
4038
)
4139
assert_matches_type(SyncV4PagePagination[SearchListResponse], search, path=["response"])
4240

@@ -93,10 +91,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
9391
account_id="023e105f4ecef8ad9ca31a8372d0c353",
9492
page=1,
9593
per_page=1,
96-
search_params={
97-
"query": "primary",
98-
"references": "*",
99-
},
94+
query="primary",
95+
references="*",
10096
)
10197
assert_matches_type(AsyncV4PagePagination[SearchListResponse], search, path=["response"])
10298

0 commit comments

Comments
 (0)