Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(internal): add cleaner handling of DNS unions #2270

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1462
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4118c37824cecf34c05447175906b84c57105e89ea6a092fee7047b46613e094.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-37230321c38d72a0921e2d9712bc4217c53bcfd91530bd043118800b83570891.yml
2,464 changes: 2,460 additions & 4 deletions src/cloudflare/resources/dns/records.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/cloudflare/types/dns/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

from .ttl import TTL as TTL
from .dnssec import DNSSEC as DNSSEC
from .a_record import ARecord as ARecord
from .ds_record import DSRecord as DSRecord
Expand Down
29 changes: 28 additions & 1 deletion src/cloudflare/types/dns/a_record.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,43 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing import List, Optional
from typing_extensions import Literal

from .ttl import TTL
from ..._models import BaseModel
from .record_tags import RecordTags

__all__ = ["ARecord"]


class ARecord(BaseModel):
comment: Optional[str] = None
"""Comments or notes about the DNS record.

This field has no effect on DNS responses.
"""

content: Optional[str] = None
"""A valid IPv4 address."""

name: Optional[str] = None
"""DNS record name (or @ for the zone apex) in Punycode."""

proxied: Optional[bool] = None
"""
Whether the record is receiving the performance and security benefits of
Cloudflare.
"""

tags: Optional[List[RecordTags]] = None
"""Custom tags for the DNS record. This field has no effect on DNS responses."""

ttl: Optional[TTL] = None
"""Time To Live (TTL) of the DNS record in seconds.

Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
minimum reduced to 30 for Enterprise zones.
"""

type: Optional[Literal["A"]] = None
"""Record type."""
29 changes: 29 additions & 0 deletions src/cloudflare/types/dns/a_record_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,43 @@

from __future__ import annotations

from typing import List
from typing_extensions import Literal, TypedDict

from .ttl_param import TTLParam
from .record_tags import RecordTags

__all__ = ["ARecordParam"]


class ARecordParam(TypedDict, total=False):
comment: str
"""Comments or notes about the DNS record.

This field has no effect on DNS responses.
"""

content: str
"""A valid IPv4 address."""

name: str
"""DNS record name (or @ for the zone apex) in Punycode."""

proxied: bool
"""
Whether the record is receiving the performance and security benefits of
Cloudflare.
"""

tags: List[RecordTags]
"""Custom tags for the DNS record. This field has no effect on DNS responses."""

ttl: TTLParam
"""Time To Live (TTL) of the DNS record in seconds.

Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
minimum reduced to 30 for Enterprise zones.
"""

type: Literal["A"]
"""Record type."""
29 changes: 28 additions & 1 deletion src/cloudflare/types/dns/aaaa_record.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,43 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing import List, Optional
from typing_extensions import Literal

from .ttl import TTL
from ..._models import BaseModel
from .record_tags import RecordTags

__all__ = ["AAAARecord"]


class AAAARecord(BaseModel):
comment: Optional[str] = None
"""Comments or notes about the DNS record.

This field has no effect on DNS responses.
"""

content: Optional[str] = None
"""A valid IPv6 address."""

name: Optional[str] = None
"""DNS record name (or @ for the zone apex) in Punycode."""

proxied: Optional[bool] = None
"""
Whether the record is receiving the performance and security benefits of
Cloudflare.
"""

tags: Optional[List[RecordTags]] = None
"""Custom tags for the DNS record. This field has no effect on DNS responses."""

ttl: Optional[TTL] = None
"""Time To Live (TTL) of the DNS record in seconds.

Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
minimum reduced to 30 for Enterprise zones.
"""

type: Optional[Literal["AAAA"]] = None
"""Record type."""
29 changes: 29 additions & 0 deletions src/cloudflare/types/dns/aaaa_record_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,43 @@

from __future__ import annotations

from typing import List
from typing_extensions import Literal, TypedDict

from .ttl_param import TTLParam
from .record_tags import RecordTags

__all__ = ["AAAARecordParam"]


class AAAARecordParam(TypedDict, total=False):
comment: str
"""Comments or notes about the DNS record.

This field has no effect on DNS responses.
"""

content: str
"""A valid IPv6 address."""

name: str
"""DNS record name (or @ for the zone apex) in Punycode."""

proxied: bool
"""
Whether the record is receiving the performance and security benefits of
Cloudflare.
"""

tags: List[RecordTags]
"""Custom tags for the DNS record. This field has no effect on DNS responses."""

ttl: TTLParam
"""Time To Live (TTL) of the DNS record in seconds.

Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
minimum reduced to 30 for Enterprise zones.
"""

type: Literal["AAAA"]
"""Record type."""
29 changes: 28 additions & 1 deletion src/cloudflare/types/dns/caa_record.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing import List, Optional
from typing_extensions import Literal

from .ttl import TTL
from ..._models import BaseModel
from .record_tags import RecordTags

__all__ = ["CAARecord", "Data"]

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


class CAARecord(BaseModel):
comment: Optional[str] = None
"""Comments or notes about the DNS record.

This field has no effect on DNS responses.
"""

content: Optional[str] = None
"""Formatted CAA content. See 'data' to set CAA properties."""

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

name: Optional[str] = None
"""DNS record name (or @ for the zone apex) in Punycode."""

proxied: Optional[bool] = None
"""
Whether the record is receiving the performance and security benefits of
Cloudflare.
"""

tags: Optional[List[RecordTags]] = None
"""Custom tags for the DNS record. This field has no effect on DNS responses."""

ttl: Optional[TTL] = None
"""Time To Live (TTL) of the DNS record in seconds.

Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
minimum reduced to 30 for Enterprise zones.
"""

type: Optional[Literal["CAA"]] = None
"""Record type."""
29 changes: 29 additions & 0 deletions src/cloudflare/types/dns/caa_record_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

from __future__ import annotations

from typing import List
from typing_extensions import Literal, TypedDict

from .ttl_param import TTLParam
from .record_tags import RecordTags

__all__ = ["CAARecordParam", "Data"]


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


class CAARecordParam(TypedDict, total=False):
comment: str
"""Comments or notes about the DNS record.

This field has no effect on DNS responses.
"""

data: Data
"""Components of a CAA record."""

name: str
"""DNS record name (or @ for the zone apex) in Punycode."""

proxied: bool
"""
Whether the record is receiving the performance and security benefits of
Cloudflare.
"""

tags: List[RecordTags]
"""Custom tags for the DNS record. This field has no effect on DNS responses."""

ttl: TTLParam
"""Time To Live (TTL) of the DNS record in seconds.

Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
minimum reduced to 30 for Enterprise zones.
"""

type: Literal["CAA"]
"""Record type."""
29 changes: 28 additions & 1 deletion src/cloudflare/types/dns/cert_record.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing import List, Optional
from typing_extensions import Literal

from .ttl import TTL
from ..._models import BaseModel
from .record_tags import RecordTags

__all__ = ["CERTRecord", "Data"]

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


class CERTRecord(BaseModel):
comment: Optional[str] = None
"""Comments or notes about the DNS record.

This field has no effect on DNS responses.
"""

content: Optional[str] = None
"""Formatted CERT content. See 'data' to set CERT properties."""

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

name: Optional[str] = None
"""DNS record name (or @ for the zone apex) in Punycode."""

proxied: Optional[bool] = None
"""
Whether the record is receiving the performance and security benefits of
Cloudflare.
"""

tags: Optional[List[RecordTags]] = None
"""Custom tags for the DNS record. This field has no effect on DNS responses."""

ttl: Optional[TTL] = None
"""Time To Live (TTL) of the DNS record in seconds.

Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
minimum reduced to 30 for Enterprise zones.
"""

type: Optional[Literal["CERT"]] = None
"""Record type."""
29 changes: 29 additions & 0 deletions src/cloudflare/types/dns/cert_record_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

from __future__ import annotations

from typing import List
from typing_extensions import Literal, TypedDict

from .ttl_param import TTLParam
from .record_tags import RecordTags

__all__ = ["CERTRecordParam", "Data"]


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


class CERTRecordParam(TypedDict, total=False):
comment: str
"""Comments or notes about the DNS record.

This field has no effect on DNS responses.
"""

data: Data
"""Components of a CERT record."""

name: str
"""DNS record name (or @ for the zone apex) in Punycode."""

proxied: bool
"""
Whether the record is receiving the performance and security benefits of
Cloudflare.
"""

tags: List[RecordTags]
"""Custom tags for the DNS record. This field has no effect on DNS responses."""

ttl: TTLParam
"""Time To Live (TTL) of the DNS record in seconds.

Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the
minimum reduced to 30 for Enterprise zones.
"""

type: Literal["CERT"]
"""Record type."""
Loading