Skip to content

Commit 89f4f0c

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#267)
1 parent 45906d2 commit 89f4f0c

File tree

4 files changed

+78
-2
lines changed

4 files changed

+78
-2
lines changed

src/cloudflare/resources/zones/dns_settings.py

+40-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ def edit(
4141
self,
4242
*,
4343
zone_id: str,
44+
foundation_dns: bool | NotGiven = NOT_GIVEN,
45+
multi_provider: bool | NotGiven = NOT_GIVEN,
4446
nameservers: NameserverParam | NotGiven = NOT_GIVEN,
47+
secondary_overrides: bool | NotGiven = NOT_GIVEN,
4548
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4649
# The extra values given here take precedence over values defined on the client or passed to this method.
4750
extra_headers: Headers | None = None,
@@ -55,8 +58,17 @@ def edit(
5558
Args:
5659
zone_id: Identifier
5760
61+
foundation_dns: Whether to enable Foundation DNS Advanced Nameservers on the zone.
62+
63+
multi_provider: Whether to enable multi-provider DNS, which causes Cloudflare to activate the
64+
zone even when non-Cloudflare NS records exist, and to respect NS records at the
65+
zone apex during outbound zone transfers.
66+
5867
nameservers: Settings determining the nameservers through which the zone should be available.
5968
69+
secondary_overrides: Allows a Secondary DNS zone to use (proxied) override records and CNAME
70+
flattening at the zone apex.
71+
6072
extra_headers: Send extra headers
6173
6274
extra_query: Add additional query parameters to the request
@@ -69,7 +81,15 @@ def edit(
6981
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
7082
return self._patch(
7183
f"/zones/{zone_id}/dns_settings",
72-
body=maybe_transform({"nameservers": nameservers}, dns_setting_edit_params.DNSSettingEditParams),
84+
body=maybe_transform(
85+
{
86+
"foundation_dns": foundation_dns,
87+
"multi_provider": multi_provider,
88+
"nameservers": nameservers,
89+
"secondary_overrides": secondary_overrides,
90+
},
91+
dns_setting_edit_params.DNSSettingEditParams,
92+
),
7393
options=make_request_options(
7494
extra_headers=extra_headers,
7595
extra_query=extra_query,
@@ -133,7 +153,10 @@ async def edit(
133153
self,
134154
*,
135155
zone_id: str,
156+
foundation_dns: bool | NotGiven = NOT_GIVEN,
157+
multi_provider: bool | NotGiven = NOT_GIVEN,
136158
nameservers: NameserverParam | NotGiven = NOT_GIVEN,
159+
secondary_overrides: bool | NotGiven = NOT_GIVEN,
137160
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
138161
# The extra values given here take precedence over values defined on the client or passed to this method.
139162
extra_headers: Headers | None = None,
@@ -147,8 +170,17 @@ async def edit(
147170
Args:
148171
zone_id: Identifier
149172
173+
foundation_dns: Whether to enable Foundation DNS Advanced Nameservers on the zone.
174+
175+
multi_provider: Whether to enable multi-provider DNS, which causes Cloudflare to activate the
176+
zone even when non-Cloudflare NS records exist, and to respect NS records at the
177+
zone apex during outbound zone transfers.
178+
150179
nameservers: Settings determining the nameservers through which the zone should be available.
151180
181+
secondary_overrides: Allows a Secondary DNS zone to use (proxied) override records and CNAME
182+
flattening at the zone apex.
183+
152184
extra_headers: Send extra headers
153185
154186
extra_query: Add additional query parameters to the request
@@ -162,7 +194,13 @@ async def edit(
162194
return await self._patch(
163195
f"/zones/{zone_id}/dns_settings",
164196
body=await async_maybe_transform(
165-
{"nameservers": nameservers}, dns_setting_edit_params.DNSSettingEditParams
197+
{
198+
"foundation_dns": foundation_dns,
199+
"multi_provider": multi_provider,
200+
"nameservers": nameservers,
201+
"secondary_overrides": secondary_overrides,
202+
},
203+
dns_setting_edit_params.DNSSettingEditParams,
166204
),
167205
options=make_request_options(
168206
extra_headers=extra_headers,

src/cloudflare/types/zones/dns_setting.py

+16
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,23 @@
99

1010

1111
class DNSSetting(BaseModel):
12+
foundation_dns: Optional[bool] = None
13+
"""Whether to enable Foundation DNS Advanced Nameservers on the zone."""
14+
15+
multi_provider: Optional[bool] = None
16+
"""
17+
Whether to enable multi-provider DNS, which causes Cloudflare to activate the
18+
zone even when non-Cloudflare NS records exist, and to respect NS records at the
19+
zone apex during outbound zone transfers.
20+
"""
21+
1222
nameservers: Optional[Nameserver] = None
1323
"""
1424
Settings determining the nameservers through which the zone should be available.
1525
"""
26+
27+
secondary_overrides: Optional[bool] = None
28+
"""
29+
Allows a Secondary DNS zone to use (proxied) override records and CNAME
30+
flattening at the zone apex.
31+
"""

src/cloudflare/types/zones/dns_setting_edit_params.py

+16
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,23 @@ class DNSSettingEditParams(TypedDict, total=False):
1313
zone_id: Required[str]
1414
"""Identifier"""
1515

16+
foundation_dns: bool
17+
"""Whether to enable Foundation DNS Advanced Nameservers on the zone."""
18+
19+
multi_provider: bool
20+
"""
21+
Whether to enable multi-provider DNS, which causes Cloudflare to activate the
22+
zone even when non-Cloudflare NS records exist, and to respect NS records at the
23+
zone apex during outbound zone transfers.
24+
"""
25+
1626
nameservers: NameserverParam
1727
"""
1828
Settings determining the nameservers through which the zone should be available.
1929
"""
30+
31+
secondary_overrides: bool
32+
"""
33+
Allows a Secondary DNS zone to use (proxied) override records and CNAME
34+
flattening at the zone apex.
35+
"""

tests/api_resources/zones/test_dns_settings.py

+6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ def test_method_edit(self, client: Cloudflare) -> None:
3030
def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
3131
dns_setting = client.zones.dns_settings.edit(
3232
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
33+
foundation_dns=False,
34+
multi_provider=False,
3335
nameservers={"type": "cloudflare.standard"},
36+
secondary_overrides=False,
3437
)
3538
assert_matches_type(DNSSetting, dns_setting, path=["response"])
3639

@@ -127,7 +130,10 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
127130
async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None:
128131
dns_setting = await async_client.zones.dns_settings.edit(
129132
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
133+
foundation_dns=False,
134+
multi_provider=False,
130135
nameservers={"type": "cloudflare.standard"},
136+
secondary_overrides=False,
131137
)
132138
assert_matches_type(DNSSetting, dns_setting, path=["response"])
133139

0 commit comments

Comments
 (0)