Skip to content

Commit 0086545

Browse files
chore(api): update composite API spec
1 parent 83bf4b4 commit 0086545

File tree

5 files changed

+61
-18
lines changed

5 files changed

+61
-18
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: 2095
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9d41f78e2d5a39d56d2dee9b6ba73c6149a8381ef40d0c9b0e3d85862c13cb4d.yml
3-
openapi_spec_hash: 5842fd6b532f036b7b6450c52e283a62
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-db9262d7411573a221b9bb13069bf2c908e822df9762ac016767d975a42f3f6f.yml
3+
openapi_spec_hash: 026b880b1a9c365d6f614ea210369b4f
44
config_hash: 266937b9684ec3731fb8aaa89bef4b6d

src/cloudflare/resources/brand_protection/v2/matches.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import httpx
88

9-
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
9+
from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
1010
from ...._utils import maybe_transform, async_maybe_transform
1111
from ...._compat import cached_property
1212
from ...._resource import SyncAPIResource, AsyncAPIResource
@@ -47,7 +47,8 @@ def get(
4747
self,
4848
*,
4949
account_id: str,
50-
query_id: str,
50+
query_id: SequenceNotStr[str],
51+
domain_search: str | Omit = omit,
5152
include_dismissed: str | Omit = omit,
5253
include_domain_id: str | Omit = omit,
5354
limit: str | Omit = omit,
@@ -62,9 +63,17 @@ def get(
6263
timeout: float | httpx.Timeout | None | NotGiven = not_given,
6364
) -> MatchGetResponse:
6465
"""
65-
Get paginated list of domain matches for a specific brand protection query
66+
Get paginated list of domain matches for one or more brand protection queries.
67+
When multiple query_ids are provided (comma-separated), matches are deduplicated
68+
across queries and each match includes a matched_queries array.
6669
6770
Args:
71+
query_id: Query ID or comma-separated list of Query IDs. When multiple IDs are provided,
72+
matches are deduplicated across queries and each match includes matched_queries
73+
and match_ids arrays.
74+
75+
domain_search: Filter matches by domain name (substring match)
76+
6877
order: Sort order. Options: 'asc' (ascending) or 'desc' (descending)
6978
7079
order_by: Column to sort by. Options: 'domain' or 'first_seen'
@@ -89,6 +98,7 @@ def get(
8998
query=maybe_transform(
9099
{
91100
"query_id": query_id,
101+
"domain_search": domain_search,
92102
"include_dismissed": include_dismissed,
93103
"include_domain_id": include_domain_id,
94104
"limit": limit,
@@ -127,7 +137,8 @@ async def get(
127137
self,
128138
*,
129139
account_id: str,
130-
query_id: str,
140+
query_id: SequenceNotStr[str],
141+
domain_search: str | Omit = omit,
131142
include_dismissed: str | Omit = omit,
132143
include_domain_id: str | Omit = omit,
133144
limit: str | Omit = omit,
@@ -142,9 +153,17 @@ async def get(
142153
timeout: float | httpx.Timeout | None | NotGiven = not_given,
143154
) -> MatchGetResponse:
144155
"""
145-
Get paginated list of domain matches for a specific brand protection query
156+
Get paginated list of domain matches for one or more brand protection queries.
157+
When multiple query_ids are provided (comma-separated), matches are deduplicated
158+
across queries and each match includes a matched_queries array.
146159
147160
Args:
161+
query_id: Query ID or comma-separated list of Query IDs. When multiple IDs are provided,
162+
matches are deduplicated across queries and each match includes matched_queries
163+
and match_ids arrays.
164+
165+
domain_search: Filter matches by domain name (substring match)
166+
148167
order: Sort order. Options: 'asc' (ascending) or 'desc' (descending)
149168
150169
order_by: Column to sort by. Options: 'domain' or 'first_seen'
@@ -169,6 +188,7 @@ async def get(
169188
query=await async_maybe_transform(
170189
{
171190
"query_id": query_id,
191+
"domain_search": domain_search,
172192
"include_dismissed": include_dismissed,
173193
"include_domain_id": include_domain_id,
174194
"limit": limit,

src/cloudflare/types/brand_protection/v2/match_get_params.py

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

55
from typing_extensions import Literal, Required, Annotated, TypedDict
66

7+
from ...._types import SequenceNotStr
78
from ...._utils import PropertyInfo
89

910
__all__ = ["MatchGetParams"]
@@ -12,7 +13,15 @@
1213
class MatchGetParams(TypedDict, total=False):
1314
account_id: Required[str]
1415

15-
query_id: Required[str]
16+
query_id: Required[SequenceNotStr[str]]
17+
"""Query ID or comma-separated list of Query IDs.
18+
19+
When multiple IDs are provided, matches are deduplicated across queries and each
20+
match includes matched_queries and match_ids arrays.
21+
"""
22+
23+
domain_search: str
24+
"""Filter matches by domain name (substring match)"""
1625

1726
include_dismissed: str
1827

src/cloudflare/types/brand_protection/v2/match_get_response.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ class Match(BaseModel):
2626

2727
source: Optional[str] = None
2828

29+
match_ids: Optional[List[int]] = None
30+
"""All underlying match row IDs for this domain.
31+
32+
Only present when multiple query_ids are requested.
33+
"""
34+
35+
matched_queries: Optional[List[int]] = None
36+
"""List of query IDs that produced this match.
37+
38+
Only present when multiple query_ids are requested.
39+
"""
40+
2941

3042
class MatchGetResponse(BaseModel):
3143
matches: List[Match]

tests/api_resources/brand_protection/v2/test_matches.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ class TestMatches:
2121
def test_method_get(self, client: Cloudflare) -> None:
2222
match = client.brand_protection.v2.matches.get(
2323
account_id="x",
24-
query_id="x",
24+
query_id=["string"],
2525
)
2626
assert_matches_type(MatchGetResponse, match, path=["response"])
2727

2828
@parametrize
2929
def test_method_get_with_all_params(self, client: Cloudflare) -> None:
3030
match = client.brand_protection.v2.matches.get(
3131
account_id="x",
32-
query_id="x",
32+
query_id=["string"],
33+
domain_search="domain_search",
3334
include_dismissed="include_dismissed",
3435
include_domain_id="include_domain_id",
3536
limit="limit",
@@ -43,7 +44,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
4344
def test_raw_response_get(self, client: Cloudflare) -> None:
4445
response = client.brand_protection.v2.matches.with_raw_response.get(
4546
account_id="x",
46-
query_id="x",
47+
query_id=["string"],
4748
)
4849

4950
assert response.is_closed is True
@@ -55,7 +56,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
5556
def test_streaming_response_get(self, client: Cloudflare) -> None:
5657
with client.brand_protection.v2.matches.with_streaming_response.get(
5758
account_id="x",
58-
query_id="x",
59+
query_id=["string"],
5960
) as response:
6061
assert not response.is_closed
6162
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -70,7 +71,7 @@ def test_path_params_get(self, client: Cloudflare) -> None:
7071
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
7172
client.brand_protection.v2.matches.with_raw_response.get(
7273
account_id="",
73-
query_id="x",
74+
query_id=["string"],
7475
)
7576

7677

@@ -83,15 +84,16 @@ class TestAsyncMatches:
8384
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
8485
match = await async_client.brand_protection.v2.matches.get(
8586
account_id="x",
86-
query_id="x",
87+
query_id=["string"],
8788
)
8889
assert_matches_type(MatchGetResponse, match, path=["response"])
8990

9091
@parametrize
9192
async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
9293
match = await async_client.brand_protection.v2.matches.get(
9394
account_id="x",
94-
query_id="x",
95+
query_id=["string"],
96+
domain_search="domain_search",
9597
include_dismissed="include_dismissed",
9698
include_domain_id="include_domain_id",
9799
limit="limit",
@@ -105,7 +107,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -
105107
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
106108
response = await async_client.brand_protection.v2.matches.with_raw_response.get(
107109
account_id="x",
108-
query_id="x",
110+
query_id=["string"],
109111
)
110112

111113
assert response.is_closed is True
@@ -117,7 +119,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
117119
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
118120
async with async_client.brand_protection.v2.matches.with_streaming_response.get(
119121
account_id="x",
120-
query_id="x",
122+
query_id=["string"],
121123
) as response:
122124
assert not response.is_closed
123125
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -132,5 +134,5 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
132134
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
133135
await async_client.brand_protection.v2.matches.with_raw_response.get(
134136
account_id="",
135-
query_id="x",
137+
query_id=["string"],
136138
)

0 commit comments

Comments
 (0)