Skip to content

Commit 582142f

Browse files
fix(internal): add cleaner handling of DNS unions (#2270)
1 parent 90d0608 commit 582142f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+6352
-292
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1462
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4118c37824cecf34c05447175906b84c57105e89ea6a092fee7047b46613e094.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-37230321c38d72a0921e2d9712bc4217c53bcfd91530bd043118800b83570891.yml

src/cloudflare/resources/dns/records.py

+2,460-4
Large diffs are not rendered by default.

src/cloudflare/types/dns/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from .ttl import TTL as TTL
56
from .dnssec import DNSSEC as DNSSEC
67
from .a_record import ARecord as ARecord
78
from .ds_record import DSRecord as DSRecord

src/cloudflare/types/dns/a_record.py

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

3-
from typing import Optional
3+
from typing import List, Optional
44
from typing_extensions import Literal
55

6+
from .ttl import TTL
67
from ..._models import BaseModel
8+
from .record_tags import RecordTags
79

810
__all__ = ["ARecord"]
911

1012

1113
class ARecord(BaseModel):
14+
comment: Optional[str] = None
15+
"""Comments or notes about the DNS record.
16+
17+
This field has no effect on DNS responses.
18+
"""
19+
1220
content: Optional[str] = None
1321
"""A valid IPv4 address."""
1422

23+
name: Optional[str] = None
24+
"""DNS record name (or @ for the zone apex) in Punycode."""
25+
26+
proxied: Optional[bool] = None
27+
"""
28+
Whether the record is receiving the performance and security benefits of
29+
Cloudflare.
30+
"""
31+
32+
tags: Optional[List[RecordTags]] = None
33+
"""Custom tags for the DNS record. This field has no effect on DNS responses."""
34+
35+
ttl: Optional[TTL] = None
36+
"""Time To Live (TTL) of the DNS record in seconds.
37+
38+
Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
39+
minimum reduced to 30 for Enterprise zones.
40+
"""
41+
1542
type: Optional[Literal["A"]] = None
1643
"""Record type."""

src/cloudflare/types/dns/a_record_param.py

+29
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,43 @@
22

33
from __future__ import annotations
44

5+
from typing import List
56
from typing_extensions import Literal, TypedDict
67

8+
from .ttl_param import TTLParam
9+
from .record_tags import RecordTags
10+
711
__all__ = ["ARecordParam"]
812

913

1014
class ARecordParam(TypedDict, total=False):
15+
comment: str
16+
"""Comments or notes about the DNS record.
17+
18+
This field has no effect on DNS responses.
19+
"""
20+
1121
content: str
1222
"""A valid IPv4 address."""
1323

24+
name: str
25+
"""DNS record name (or @ for the zone apex) in Punycode."""
26+
27+
proxied: bool
28+
"""
29+
Whether the record is receiving the performance and security benefits of
30+
Cloudflare.
31+
"""
32+
33+
tags: List[RecordTags]
34+
"""Custom tags for the DNS record. This field has no effect on DNS responses."""
35+
36+
ttl: TTLParam
37+
"""Time To Live (TTL) of the DNS record in seconds.
38+
39+
Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
40+
minimum reduced to 30 for Enterprise zones.
41+
"""
42+
1443
type: Literal["A"]
1544
"""Record type."""
+28-1
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,43 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Optional
3+
from typing import List, Optional
44
from typing_extensions import Literal
55

6+
from .ttl import TTL
67
from ..._models import BaseModel
8+
from .record_tags import RecordTags
79

810
__all__ = ["AAAARecord"]
911

1012

1113
class AAAARecord(BaseModel):
14+
comment: Optional[str] = None
15+
"""Comments or notes about the DNS record.
16+
17+
This field has no effect on DNS responses.
18+
"""
19+
1220
content: Optional[str] = None
1321
"""A valid IPv6 address."""
1422

23+
name: Optional[str] = None
24+
"""DNS record name (or @ for the zone apex) in Punycode."""
25+
26+
proxied: Optional[bool] = None
27+
"""
28+
Whether the record is receiving the performance and security benefits of
29+
Cloudflare.
30+
"""
31+
32+
tags: Optional[List[RecordTags]] = None
33+
"""Custom tags for the DNS record. This field has no effect on DNS responses."""
34+
35+
ttl: Optional[TTL] = None
36+
"""Time To Live (TTL) of the DNS record in seconds.
37+
38+
Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
39+
minimum reduced to 30 for Enterprise zones.
40+
"""
41+
1542
type: Optional[Literal["AAAA"]] = None
1643
"""Record type."""

src/cloudflare/types/dns/aaaa_record_param.py

+29
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,43 @@
22

33
from __future__ import annotations
44

5+
from typing import List
56
from typing_extensions import Literal, TypedDict
67

8+
from .ttl_param import TTLParam
9+
from .record_tags import RecordTags
10+
711
__all__ = ["AAAARecordParam"]
812

913

1014
class AAAARecordParam(TypedDict, total=False):
15+
comment: str
16+
"""Comments or notes about the DNS record.
17+
18+
This field has no effect on DNS responses.
19+
"""
20+
1121
content: str
1222
"""A valid IPv6 address."""
1323

24+
name: str
25+
"""DNS record name (or @ for the zone apex) in Punycode."""
26+
27+
proxied: bool
28+
"""
29+
Whether the record is receiving the performance and security benefits of
30+
Cloudflare.
31+
"""
32+
33+
tags: List[RecordTags]
34+
"""Custom tags for the DNS record. This field has no effect on DNS responses."""
35+
36+
ttl: TTLParam
37+
"""Time To Live (TTL) of the DNS record in seconds.
38+
39+
Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
40+
minimum reduced to 30 for Enterprise zones.
41+
"""
42+
1443
type: Literal["AAAA"]
1544
"""Record type."""

src/cloudflare/types/dns/caa_record.py

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

3-
from typing import Optional
3+
from typing import List, Optional
44
from typing_extensions import Literal
55

6+
from .ttl import TTL
67
from ..._models import BaseModel
8+
from .record_tags import RecordTags
79

810
__all__ = ["CAARecord", "Data"]
911

@@ -20,11 +22,36 @@ class Data(BaseModel):
2022

2123

2224
class CAARecord(BaseModel):
25+
comment: Optional[str] = None
26+
"""Comments or notes about the DNS record.
27+
28+
This field has no effect on DNS responses.
29+
"""
30+
2331
content: Optional[str] = None
2432
"""Formatted CAA content. See 'data' to set CAA properties."""
2533

2634
data: Optional[Data] = None
2735
"""Components of a CAA record."""
2836

37+
name: Optional[str] = None
38+
"""DNS record name (or @ for the zone apex) in Punycode."""
39+
40+
proxied: Optional[bool] = None
41+
"""
42+
Whether the record is receiving the performance and security benefits of
43+
Cloudflare.
44+
"""
45+
46+
tags: Optional[List[RecordTags]] = None
47+
"""Custom tags for the DNS record. This field has no effect on DNS responses."""
48+
49+
ttl: Optional[TTL] = None
50+
"""Time To Live (TTL) of the DNS record in seconds.
51+
52+
Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
53+
minimum reduced to 30 for Enterprise zones.
54+
"""
55+
2956
type: Optional[Literal["CAA"]] = None
3057
"""Record type."""

src/cloudflare/types/dns/caa_record_param.py

+29
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
from __future__ import annotations
44

5+
from typing import List
56
from typing_extensions import Literal, TypedDict
67

8+
from .ttl_param import TTLParam
9+
from .record_tags import RecordTags
10+
711
__all__ = ["CAARecordParam", "Data"]
812

913

@@ -19,8 +23,33 @@ class Data(TypedDict, total=False):
1923

2024

2125
class CAARecordParam(TypedDict, total=False):
26+
comment: str
27+
"""Comments or notes about the DNS record.
28+
29+
This field has no effect on DNS responses.
30+
"""
31+
2232
data: Data
2333
"""Components of a CAA record."""
2434

35+
name: str
36+
"""DNS record name (or @ for the zone apex) in Punycode."""
37+
38+
proxied: bool
39+
"""
40+
Whether the record is receiving the performance and security benefits of
41+
Cloudflare.
42+
"""
43+
44+
tags: List[RecordTags]
45+
"""Custom tags for the DNS record. This field has no effect on DNS responses."""
46+
47+
ttl: TTLParam
48+
"""Time To Live (TTL) of the DNS record in seconds.
49+
50+
Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
51+
minimum reduced to 30 for Enterprise zones.
52+
"""
53+
2554
type: Literal["CAA"]
2655
"""Record type."""

src/cloudflare/types/dns/cert_record.py

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

3-
from typing import Optional
3+
from typing import List, Optional
44
from typing_extensions import Literal
55

6+
from .ttl import TTL
67
from ..._models import BaseModel
8+
from .record_tags import RecordTags
79

810
__all__ = ["CERTRecord", "Data"]
911

@@ -23,11 +25,36 @@ class Data(BaseModel):
2325

2426

2527
class CERTRecord(BaseModel):
28+
comment: Optional[str] = None
29+
"""Comments or notes about the DNS record.
30+
31+
This field has no effect on DNS responses.
32+
"""
33+
2634
content: Optional[str] = None
2735
"""Formatted CERT content. See 'data' to set CERT properties."""
2836

2937
data: Optional[Data] = None
3038
"""Components of a CERT record."""
3139

40+
name: Optional[str] = None
41+
"""DNS record name (or @ for the zone apex) in Punycode."""
42+
43+
proxied: Optional[bool] = None
44+
"""
45+
Whether the record is receiving the performance and security benefits of
46+
Cloudflare.
47+
"""
48+
49+
tags: Optional[List[RecordTags]] = None
50+
"""Custom tags for the DNS record. This field has no effect on DNS responses."""
51+
52+
ttl: Optional[TTL] = None
53+
"""Time To Live (TTL) of the DNS record in seconds.
54+
55+
Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
56+
minimum reduced to 30 for Enterprise zones.
57+
"""
58+
3259
type: Optional[Literal["CERT"]] = None
3360
"""Record type."""

src/cloudflare/types/dns/cert_record_param.py

+29
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
from __future__ import annotations
44

5+
from typing import List
56
from typing_extensions import Literal, TypedDict
67

8+
from .ttl_param import TTLParam
9+
from .record_tags import RecordTags
10+
711
__all__ = ["CERTRecordParam", "Data"]
812

913

@@ -22,8 +26,33 @@ class Data(TypedDict, total=False):
2226

2327

2428
class CERTRecordParam(TypedDict, total=False):
29+
comment: str
30+
"""Comments or notes about the DNS record.
31+
32+
This field has no effect on DNS responses.
33+
"""
34+
2535
data: Data
2636
"""Components of a CERT record."""
2737

38+
name: str
39+
"""DNS record name (or @ for the zone apex) in Punycode."""
40+
41+
proxied: bool
42+
"""
43+
Whether the record is receiving the performance and security benefits of
44+
Cloudflare.
45+
"""
46+
47+
tags: List[RecordTags]
48+
"""Custom tags for the DNS record. This field has no effect on DNS responses."""
49+
50+
ttl: TTLParam
51+
"""Time To Live (TTL) of the DNS record in seconds.
52+
53+
Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
54+
minimum reduced to 30 for Enterprise zones.
55+
"""
56+
2857
type: Literal["CERT"]
2958
"""Record type."""

0 commit comments

Comments
 (0)