Skip to content

Commit 176aa63

Browse files
feat(api): api update (#2503)
1 parent b30310f commit 176aa63

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1565
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3b5a1ea1dce9d3296fb22dddcbaab546b46a66b7ebd012b1d0c7cbd791975c4d.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-27941e10b3625856a9a697f78b5a2c01e8d653d642cf5fa35a1ba8cac52974fa.yml

src/cloudflare/resources/zero_trust/networks/routes/ips.py

+24-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def get(
5252
ip: str,
5353
*,
5454
account_id: str,
55+
default_virtual_network_fallback: bool | NotGiven = NOT_GIVEN,
5556
virtual_network_id: str | NotGiven = NOT_GIVEN,
5657
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5758
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -66,6 +67,11 @@ def get(
6667
Args:
6768
account_id: Cloudflare account ID
6869
70+
default_virtual_network_fallback: When the virtual_network_id parameter is not provided the request filter will
71+
default search routes that are in the default virtual network for the account.
72+
If this parameter is set to false, the search will include routes that do not
73+
have a virtual network.
74+
6975
virtual_network_id: UUID of the virtual network.
7076
7177
extra_headers: Send extra headers
@@ -87,7 +93,13 @@ def get(
8793
extra_query=extra_query,
8894
extra_body=extra_body,
8995
timeout=timeout,
90-
query=maybe_transform({"virtual_network_id": virtual_network_id}, ip_get_params.IPGetParams),
96+
query=maybe_transform(
97+
{
98+
"default_virtual_network_fallback": default_virtual_network_fallback,
99+
"virtual_network_id": virtual_network_id,
100+
},
101+
ip_get_params.IPGetParams,
102+
),
91103
post_parser=ResultWrapper[Teamnet]._unwrapper,
92104
),
93105
cast_to=cast(Type[Teamnet], ResultWrapper[Teamnet]),
@@ -119,6 +131,7 @@ async def get(
119131
ip: str,
120132
*,
121133
account_id: str,
134+
default_virtual_network_fallback: bool | NotGiven = NOT_GIVEN,
122135
virtual_network_id: str | NotGiven = NOT_GIVEN,
123136
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
124137
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -133,6 +146,11 @@ async def get(
133146
Args:
134147
account_id: Cloudflare account ID
135148
149+
default_virtual_network_fallback: When the virtual_network_id parameter is not provided the request filter will
150+
default search routes that are in the default virtual network for the account.
151+
If this parameter is set to false, the search will include routes that do not
152+
have a virtual network.
153+
136154
virtual_network_id: UUID of the virtual network.
137155
138156
extra_headers: Send extra headers
@@ -155,7 +173,11 @@ async def get(
155173
extra_body=extra_body,
156174
timeout=timeout,
157175
query=await async_maybe_transform(
158-
{"virtual_network_id": virtual_network_id}, ip_get_params.IPGetParams
176+
{
177+
"default_virtual_network_fallback": default_virtual_network_fallback,
178+
"virtual_network_id": virtual_network_id,
179+
},
180+
ip_get_params.IPGetParams,
159181
),
160182
post_parser=ResultWrapper[Teamnet]._unwrapper,
161183
),

src/cloudflare/types/zero_trust/networks/routes/ip_get_params.py

+8
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,13 @@ class IPGetParams(TypedDict, total=False):
1111
account_id: Required[str]
1212
"""Cloudflare account ID"""
1313

14+
default_virtual_network_fallback: bool
15+
"""
16+
When the virtual_network_id parameter is not provided the request filter will
17+
default search routes that are in the default virtual network for the account.
18+
If this parameter is set to false, the search will include routes that do not
19+
have a virtual network.
20+
"""
21+
1422
virtual_network_id: str
1523
"""UUID of the virtual network."""

tests/api_resources/zero_trust/networks/routes/test_ips.py

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
3030
ip = client.zero_trust.networks.routes.ips.get(
3131
ip="10.1.0.137",
3232
account_id="699d98642c564d2e855e9661899b7252",
33+
default_virtual_network_fallback=True,
3334
virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
3435
)
3536
assert_matches_type(Teamnet, ip, path=["response"])
@@ -91,6 +92,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -
9192
ip = await async_client.zero_trust.networks.routes.ips.get(
9293
ip="10.1.0.137",
9394
account_id="699d98642c564d2e855e9661899b7252",
95+
default_virtual_network_fallback=True,
9496
virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
9597
)
9698
assert_matches_type(Teamnet, ip, path=["response"])

0 commit comments

Comments
 (0)