Skip to content

Commit d3c3d58

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#820)
1 parent 0592df8 commit d3c3d58

File tree

5 files changed

+140
-4
lines changed

5 files changed

+140
-4
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1335
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1a0beb27a59a3abb36f2931ebc3fc1bcbf0f91a8da100fc87d2254a85549879b.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-13157b0171e236329a3811eedbce4e5b71b517be66de1126b5dcb6ac4b964ee6.yml

src/cloudflare/resources/zones/dns_settings.py

+25
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Type, Optional, cast
6+
from typing_extensions import Literal
67

78
import httpx
89

@@ -46,7 +47,10 @@ def edit(
4647
foundation_dns: bool | NotGiven = NOT_GIVEN,
4748
multi_provider: bool | NotGiven = NOT_GIVEN,
4849
nameservers: NameserverParam | NotGiven = NOT_GIVEN,
50+
ns_ttl: float | NotGiven = NOT_GIVEN,
4951
secondary_overrides: bool | NotGiven = NOT_GIVEN,
52+
soa: dns_setting_edit_params.Soa | NotGiven = NOT_GIVEN,
53+
zone_mode: Literal["standard", "cdn_only", "dns_only"] | NotGiven = NOT_GIVEN,
5054
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5155
# The extra values given here take precedence over values defined on the client or passed to this method.
5256
extra_headers: Headers | None = None,
@@ -68,9 +72,15 @@ def edit(
6872
6973
nameservers: Settings determining the nameservers through which the zone should be available.
7074
75+
ns_ttl: The time to live (TTL) of the zone's nameserver (NS) records.
76+
7177
secondary_overrides: Allows a Secondary DNS zone to use (proxied) override records and CNAME
7278
flattening at the zone apex.
7379
80+
soa: Components of the zone's SOA record.
81+
82+
zone_mode: Whether the zone mode is a regular or CDN/DNS only zone.
83+
7484
extra_headers: Send extra headers
7585
7686
extra_query: Add additional query parameters to the request
@@ -88,7 +98,10 @@ def edit(
8898
"foundation_dns": foundation_dns,
8999
"multi_provider": multi_provider,
90100
"nameservers": nameservers,
101+
"ns_ttl": ns_ttl,
91102
"secondary_overrides": secondary_overrides,
103+
"soa": soa,
104+
"zone_mode": zone_mode,
92105
},
93106
dns_setting_edit_params.DNSSettingEditParams,
94107
),
@@ -158,7 +171,10 @@ async def edit(
158171
foundation_dns: bool | NotGiven = NOT_GIVEN,
159172
multi_provider: bool | NotGiven = NOT_GIVEN,
160173
nameservers: NameserverParam | NotGiven = NOT_GIVEN,
174+
ns_ttl: float | NotGiven = NOT_GIVEN,
161175
secondary_overrides: bool | NotGiven = NOT_GIVEN,
176+
soa: dns_setting_edit_params.Soa | NotGiven = NOT_GIVEN,
177+
zone_mode: Literal["standard", "cdn_only", "dns_only"] | NotGiven = NOT_GIVEN,
162178
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
163179
# The extra values given here take precedence over values defined on the client or passed to this method.
164180
extra_headers: Headers | None = None,
@@ -180,9 +196,15 @@ async def edit(
180196
181197
nameservers: Settings determining the nameservers through which the zone should be available.
182198
199+
ns_ttl: The time to live (TTL) of the zone's nameserver (NS) records.
200+
183201
secondary_overrides: Allows a Secondary DNS zone to use (proxied) override records and CNAME
184202
flattening at the zone apex.
185203
204+
soa: Components of the zone's SOA record.
205+
206+
zone_mode: Whether the zone mode is a regular or CDN/DNS only zone.
207+
186208
extra_headers: Send extra headers
187209
188210
extra_query: Add additional query parameters to the request
@@ -200,7 +222,10 @@ async def edit(
200222
"foundation_dns": foundation_dns,
201223
"multi_provider": multi_provider,
202224
"nameservers": nameservers,
225+
"ns_ttl": ns_ttl,
203226
"secondary_overrides": secondary_overrides,
227+
"soa": soa,
228+
"zone_mode": zone_mode,
204229
},
205230
dns_setting_edit_params.DNSSettingEditParams,
206231
),

src/cloudflare/types/zones/dns_setting.py

+46-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,47 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import Optional
4+
from typing_extensions import Literal
45

56
from ..._models import BaseModel
67
from .nameserver import Nameserver
78

8-
__all__ = ["DNSSetting"]
9+
__all__ = ["DNSSetting", "Soa"]
10+
11+
12+
class Soa(BaseModel):
13+
expire: float
14+
"""
15+
Time in seconds of being unable to query the primary server after which
16+
secondary servers should stop serving the zone.
17+
"""
18+
19+
min_ttl: float
20+
"""The time to live (TTL) for negative caching of records within the zone."""
21+
22+
mname: str
23+
"""The primary nameserver, which may be used for outbound zone transfers."""
24+
25+
refresh: float
26+
"""
27+
Time in seconds after which secondary servers should re-check the SOA record to
28+
see if the zone has been updated.
29+
"""
30+
31+
retry: float
32+
"""
33+
Time in seconds after which secondary servers should retry queries after the
34+
primary server was unresponsive.
35+
"""
36+
37+
rname: str
38+
"""
39+
The email address of the zone administrator, with the first label representing
40+
the local part of the email address.
41+
"""
42+
43+
ttl: float
44+
"""The time to live (TTL) of the SOA record itself."""
945

1046

1147
class DNSSetting(BaseModel):
@@ -24,8 +60,17 @@ class DNSSetting(BaseModel):
2460
Settings determining the nameservers through which the zone should be available.
2561
"""
2662

63+
ns_ttl: Optional[float] = None
64+
"""The time to live (TTL) of the zone's nameserver (NS) records."""
65+
2766
secondary_overrides: Optional[bool] = None
2867
"""
2968
Allows a Secondary DNS zone to use (proxied) override records and CNAME
3069
flattening at the zone apex.
3170
"""
71+
72+
soa: Optional[Soa] = None
73+
"""Components of the zone's SOA record."""
74+
75+
zone_mode: Optional[Literal["standard", "cdn_only", "dns_only"]] = None
76+
"""Whether the zone mode is a regular or CDN/DNS only zone."""

src/cloudflare/types/zones/dns_setting_edit_params.py

+46-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Required, TypedDict
5+
from typing_extensions import Literal, Required, TypedDict
66

77
from .nameserver_param import NameserverParam
88

9-
__all__ = ["DNSSettingEditParams"]
9+
__all__ = ["DNSSettingEditParams", "Soa"]
1010

1111

1212
class DNSSettingEditParams(TypedDict, total=False):
@@ -28,8 +28,52 @@ class DNSSettingEditParams(TypedDict, total=False):
2828
Settings determining the nameservers through which the zone should be available.
2929
"""
3030

31+
ns_ttl: float
32+
"""The time to live (TTL) of the zone's nameserver (NS) records."""
33+
3134
secondary_overrides: bool
3235
"""
3336
Allows a Secondary DNS zone to use (proxied) override records and CNAME
3437
flattening at the zone apex.
3538
"""
39+
40+
soa: Soa
41+
"""Components of the zone's SOA record."""
42+
43+
zone_mode: Literal["standard", "cdn_only", "dns_only"]
44+
"""Whether the zone mode is a regular or CDN/DNS only zone."""
45+
46+
47+
class Soa(TypedDict, total=False):
48+
expire: Required[float]
49+
"""
50+
Time in seconds of being unable to query the primary server after which
51+
secondary servers should stop serving the zone.
52+
"""
53+
54+
min_ttl: Required[float]
55+
"""The time to live (TTL) for negative caching of records within the zone."""
56+
57+
mname: Required[str]
58+
"""The primary nameserver, which may be used for outbound zone transfers."""
59+
60+
refresh: Required[float]
61+
"""
62+
Time in seconds after which secondary servers should re-check the SOA record to
63+
see if the zone has been updated.
64+
"""
65+
66+
retry: Required[float]
67+
"""
68+
Time in seconds after which secondary servers should retry queries after the
69+
primary server was unresponsive.
70+
"""
71+
72+
rname: Required[str]
73+
"""
74+
The email address of the zone administrator, with the first label representing
75+
the local part of the email address.
76+
"""
77+
78+
ttl: Required[float]
79+
"""The time to live (TTL) of the SOA record itself."""

tests/api_resources/zones/test_dns_settings.py

+22
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,18 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
3131
foundation_dns=False,
3232
multi_provider=False,
3333
nameservers={"type": "cloudflare.standard"},
34+
ns_ttl=86400,
3435
secondary_overrides=False,
36+
soa={
37+
"expire": 604800,
38+
"min_ttl": 1800,
39+
"mname": "kristina.ns.cloudflare.com",
40+
"refresh": 10000,
41+
"retry": 2400,
42+
"rname": "admin.example.com",
43+
"ttl": 3600,
44+
},
45+
zone_mode="dns_only",
3546
)
3647
assert_matches_type(Optional[DNSSetting], dns_setting, path=["response"])
3748

@@ -122,7 +133,18 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare)
122133
foundation_dns=False,
123134
multi_provider=False,
124135
nameservers={"type": "cloudflare.standard"},
136+
ns_ttl=86400,
125137
secondary_overrides=False,
138+
soa={
139+
"expire": 604800,
140+
"min_ttl": 1800,
141+
"mname": "kristina.ns.cloudflare.com",
142+
"refresh": 10000,
143+
"retry": 2400,
144+
"rname": "admin.example.com",
145+
"ttl": 3600,
146+
},
147+
zone_mode="dns_only",
126148
)
127149
assert_matches_type(Optional[DNSSetting], dns_setting, path=["response"])
128150

0 commit comments

Comments
 (0)