diff --git a/.stats.yml b/.stats.yml index acff47d027a..4698450272a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1417 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-be2691c434328287926707d60e7e55c671a53351999dc9a67ca971e84fa499f6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3019ca36c889678c47db09abc7882daa9c50171912385a7bff7d83dcb3e95d57.yml diff --git a/api.md b/api.md index 38857e0b83f..b1dcaf3fee7 100644 --- a/api.md +++ b/api.md @@ -1039,7 +1039,7 @@ Methods: Types: ```python -from cloudflare.types.dns import DNSSetting, Nameserver, SettingEditResponse, SettingGetResponse +from cloudflare.types.dns import DNSSetting, SettingEditResponse, SettingGetResponse ``` Methods: diff --git a/src/cloudflare/resources/dns/settings/settings.py b/src/cloudflare/resources/dns/settings/settings.py index ef290c3d6cd..66ea1efd97c 100644 --- a/src/cloudflare/resources/dns/settings/settings.py +++ b/src/cloudflare/resources/dns/settings/settings.py @@ -30,7 +30,6 @@ from ...._wrappers import ResultWrapper from ....types.dns import setting_edit_params from ...._base_client import make_request_options -from ....types.dns.dns_setting_param import DNSSettingParam from ....types.dns.setting_get_response import SettingGetResponse from ....types.dns.setting_edit_response import SettingEditResponse @@ -66,7 +65,7 @@ def edit( *, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - zone_defaults: DNSSettingParam | NotGiven = NOT_GIVEN, + zone_defaults: setting_edit_params.ZoneDefaults | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -197,7 +196,7 @@ async def edit( *, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - zone_defaults: DNSSettingParam | NotGiven = NOT_GIVEN, + zone_defaults: setting_edit_params.ZoneDefaults | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/types/dns/__init__.py b/src/cloudflare/types/dns/__init__.py index 6d9aa469bc7..46622b2fcf3 100644 --- a/src/cloudflare/types/dns/__init__.py +++ b/src/cloudflare/types/dns/__init__.py @@ -8,14 +8,12 @@ from .ns_record import NSRecord as NSRecord from .caa_record import CAARecord as CAARecord from .loc_record import LOCRecord as LOCRecord -from .nameserver import Nameserver as Nameserver from .ptr_record import PTRRecord as PTRRecord from .srv_record import SRVRecord as SRVRecord from .txt_record import TXTRecord as TXTRecord from .uri_record import URIRecord as URIRecord from .aaaa_record import AAAARecord as AAAARecord from .cert_record import CERTRecord as CERTRecord -from .dns_setting import DNSSetting as DNSSetting from .record_tags import RecordTags as RecordTags from .svcb_record import SVCBRecord as SVCBRecord from .tlsa_record import TLSARecord as TLSARecord @@ -34,7 +32,6 @@ from .ns_record_param import NSRecordParam as NSRecordParam from .caa_record_param import CAARecordParam as CAARecordParam from .loc_record_param import LOCRecordParam as LOCRecordParam -from .nameserver_param import NameserverParam as NameserverParam from .ptr_record_param import PTRRecordParam as PTRRecordParam from .srv_record_param import SRVRecordParam as SRVRecordParam from .txt_record_param import TXTRecordParam as TXTRecordParam @@ -42,7 +39,6 @@ from .aaaa_record_param import AAAARecordParam as AAAARecordParam from .attack_mitigation import AttackMitigation as AttackMitigation from .cert_record_param import CERTRecordParam as CERTRecordParam -from .dns_setting_param import DNSSettingParam as DNSSettingParam from .svcb_record_param import SVCBRecordParam as SVCBRecordParam from .tlsa_record_param import TLSARecordParam as TLSARecordParam from .cname_record_param import CNAMERecordParam as CNAMERecordParam diff --git a/src/cloudflare/types/dns/dns_setting.py b/src/cloudflare/types/dns/dns_setting.py deleted file mode 100644 index 31183e6f2a5..00000000000 --- a/src/cloudflare/types/dns/dns_setting.py +++ /dev/null @@ -1,83 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from ..._models import BaseModel -from .nameserver import Nameserver - -__all__ = ["DNSSetting", "SOA"] - - -class SOA(BaseModel): - expire: float - """ - Time in seconds of being unable to query the primary server after which - secondary servers should stop serving the zone. - """ - - min_ttl: float - """The time to live (TTL) for negative caching of records within the zone.""" - - mname: str - """The primary nameserver, which may be used for outbound zone transfers.""" - - refresh: float - """ - Time in seconds after which secondary servers should re-check the SOA record to - see if the zone has been updated. - """ - - retry: float - """ - Time in seconds after which secondary servers should retry queries after the - primary server was unresponsive. - """ - - rname: str - """ - The email address of the zone administrator, with the first label representing - the local part of the email address. - """ - - ttl: float - """The time to live (TTL) of the SOA record itself.""" - - -class DNSSetting(BaseModel): - flatten_all_cnames: Optional[bool] = None - """Whether to flatten all CNAME records in the zone. - - Note that, due to DNS limitations, a CNAME record at the zone apex will always - be flattened. - """ - - foundation_dns: Optional[bool] = None - """Whether to enable Foundation DNS Advanced Nameservers on the zone.""" - - multi_provider: Optional[bool] = None - """ - Whether to enable multi-provider DNS, which causes Cloudflare to activate the - zone even when non-Cloudflare NS records exist, and to respect NS records at the - zone apex during outbound zone transfers. - """ - - nameservers: Optional[Nameserver] = None - """ - Settings determining the nameservers through which the zone should be available. - """ - - ns_ttl: Optional[float] = None - """The time to live (TTL) of the zone's nameserver (NS) records.""" - - secondary_overrides: Optional[bool] = None - """ - Allows a Secondary DNS zone to use (proxied) override records and CNAME - flattening at the zone apex. - """ - - soa: Optional[SOA] = None - """Components of the zone's SOA record.""" - - zone_mode: Optional[Literal["standard", "cdn_only", "dns_only"]] = None - """Whether the zone mode is a regular or CDN/DNS only zone.""" diff --git a/src/cloudflare/types/dns/dns_setting_param.py b/src/cloudflare/types/dns/dns_setting_param.py deleted file mode 100644 index b818c0fd46f..00000000000 --- a/src/cloudflare/types/dns/dns_setting_param.py +++ /dev/null @@ -1,83 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -from .nameserver_param import NameserverParam - -__all__ = ["DNSSettingParam", "SOA"] - - -class SOA(TypedDict, total=False): - expire: Required[float] - """ - Time in seconds of being unable to query the primary server after which - secondary servers should stop serving the zone. - """ - - min_ttl: Required[float] - """The time to live (TTL) for negative caching of records within the zone.""" - - mname: Required[str] - """The primary nameserver, which may be used for outbound zone transfers.""" - - refresh: Required[float] - """ - Time in seconds after which secondary servers should re-check the SOA record to - see if the zone has been updated. - """ - - retry: Required[float] - """ - Time in seconds after which secondary servers should retry queries after the - primary server was unresponsive. - """ - - rname: Required[str] - """ - The email address of the zone administrator, with the first label representing - the local part of the email address. - """ - - ttl: Required[float] - """The time to live (TTL) of the SOA record itself.""" - - -class DNSSettingParam(TypedDict, total=False): - flatten_all_cnames: bool - """Whether to flatten all CNAME records in the zone. - - Note that, due to DNS limitations, a CNAME record at the zone apex will always - be flattened. - """ - - foundation_dns: bool - """Whether to enable Foundation DNS Advanced Nameservers on the zone.""" - - multi_provider: bool - """ - Whether to enable multi-provider DNS, which causes Cloudflare to activate the - zone even when non-Cloudflare NS records exist, and to respect NS records at the - zone apex during outbound zone transfers. - """ - - nameservers: NameserverParam - """ - Settings determining the nameservers through which the zone should be available. - """ - - ns_ttl: float - """The time to live (TTL) of the zone's nameserver (NS) records.""" - - secondary_overrides: bool - """ - Allows a Secondary DNS zone to use (proxied) override records and CNAME - flattening at the zone apex. - """ - - soa: SOA - """Components of the zone's SOA record.""" - - zone_mode: Literal["standard", "cdn_only", "dns_only"] - """Whether the zone mode is a regular or CDN/DNS only zone.""" diff --git a/src/cloudflare/types/dns/nameserver.py b/src/cloudflare/types/dns/nameserver.py deleted file mode 100644 index 138ec671a62..00000000000 --- a/src/cloudflare/types/dns/nameserver.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["Nameserver"] - - -class Nameserver(BaseModel): - type: Literal["cloudflare.standard", "cloudflare.standard.random", "custom.account", "custom.tenant", "custom.zone"] - """Nameserver type""" diff --git a/src/cloudflare/types/dns/nameserver_param.py b/src/cloudflare/types/dns/nameserver_param.py deleted file mode 100644 index ce2ad5c0a54..00000000000 --- a/src/cloudflare/types/dns/nameserver_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["NameserverParam"] - - -class NameserverParam(TypedDict, total=False): - type: Required[ - Literal["cloudflare.standard", "cloudflare.standard.random", "custom.account", "custom.tenant", "custom.zone"] - ] - """Nameserver type""" diff --git a/src/cloudflare/types/dns/setting_edit_params.py b/src/cloudflare/types/dns/setting_edit_params.py index 1ac1ba3eeae..3e5b2d51a74 100644 --- a/src/cloudflare/types/dns/setting_edit_params.py +++ b/src/cloudflare/types/dns/setting_edit_params.py @@ -2,11 +2,9 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, TypedDict -from .dns_setting_param import DNSSettingParam - -__all__ = ["SettingEditParams"] +__all__ = ["SettingEditParams", "ZoneDefaults", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] class SettingEditParams(TypedDict, total=False): @@ -16,4 +14,83 @@ class SettingEditParams(TypedDict, total=False): zone_id: str """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" - zone_defaults: DNSSettingParam + zone_defaults: ZoneDefaults + + +class ZoneDefaultsNameservers(TypedDict, total=False): + type: Required[Literal["cloudflare.standard", "cloudflare.standard.random", "custom.account", "custom.tenant"]] + """Nameserver type""" + + +class ZoneDefaultsSOA(TypedDict, total=False): + expire: Required[float] + """ + Time in seconds of being unable to query the primary server after which + secondary servers should stop serving the zone. + """ + + min_ttl: Required[float] + """The time to live (TTL) for negative caching of records within the zone.""" + + mname: Required[str] + """The primary nameserver, which may be used for outbound zone transfers.""" + + refresh: Required[float] + """ + Time in seconds after which secondary servers should re-check the SOA record to + see if the zone has been updated. + """ + + retry: Required[float] + """ + Time in seconds after which secondary servers should retry queries after the + primary server was unresponsive. + """ + + rname: Required[str] + """ + The email address of the zone administrator, with the first label representing + the local part of the email address. + """ + + ttl: Required[float] + """The time to live (TTL) of the SOA record itself.""" + + +class ZoneDefaults(TypedDict, total=False): + flatten_all_cnames: bool + """Whether to flatten all CNAME records in the zone. + + Note that, due to DNS limitations, a CNAME record at the zone apex will always + be flattened. + """ + + foundation_dns: bool + """Whether to enable Foundation DNS Advanced Nameservers on the zone.""" + + multi_provider: bool + """ + Whether to enable multi-provider DNS, which causes Cloudflare to activate the + zone even when non-Cloudflare NS records exist, and to respect NS records at the + zone apex during outbound zone transfers. + """ + + nameservers: ZoneDefaultsNameservers + """ + Settings determining the nameservers through which the zone should be available. + """ + + ns_ttl: float + """The time to live (TTL) of the zone's nameserver (NS) records.""" + + secondary_overrides: bool + """ + Allows a Secondary DNS zone to use (proxied) override records and CNAME + flattening at the zone apex. + """ + + soa: ZoneDefaultsSOA + """Components of the zone's SOA record.""" + + zone_mode: Literal["standard", "cdn_only", "dns_only"] + """Whether the zone mode is a regular or CDN/DNS only zone.""" diff --git a/src/cloudflare/types/dns/setting_edit_response.py b/src/cloudflare/types/dns/setting_edit_response.py index 87a73a5356f..186fb18e610 100644 --- a/src/cloudflare/types/dns/setting_edit_response.py +++ b/src/cloudflare/types/dns/setting_edit_response.py @@ -1,12 +1,91 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from typing_extensions import Literal from ..._models import BaseModel -from .dns_setting import DNSSetting -__all__ = ["SettingEditResponse"] +__all__ = ["SettingEditResponse", "ZoneDefaults", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] + + +class ZoneDefaultsNameservers(BaseModel): + type: Literal["cloudflare.standard", "cloudflare.standard.random", "custom.account", "custom.tenant"] + """Nameserver type""" + + +class ZoneDefaultsSOA(BaseModel): + expire: float + """ + Time in seconds of being unable to query the primary server after which + secondary servers should stop serving the zone. + """ + + min_ttl: float + """The time to live (TTL) for negative caching of records within the zone.""" + + mname: str + """The primary nameserver, which may be used for outbound zone transfers.""" + + refresh: float + """ + Time in seconds after which secondary servers should re-check the SOA record to + see if the zone has been updated. + """ + + retry: float + """ + Time in seconds after which secondary servers should retry queries after the + primary server was unresponsive. + """ + + rname: str + """ + The email address of the zone administrator, with the first label representing + the local part of the email address. + """ + + ttl: float + """The time to live (TTL) of the SOA record itself.""" + + +class ZoneDefaults(BaseModel): + flatten_all_cnames: Optional[bool] = None + """Whether to flatten all CNAME records in the zone. + + Note that, due to DNS limitations, a CNAME record at the zone apex will always + be flattened. + """ + + foundation_dns: Optional[bool] = None + """Whether to enable Foundation DNS Advanced Nameservers on the zone.""" + + multi_provider: Optional[bool] = None + """ + Whether to enable multi-provider DNS, which causes Cloudflare to activate the + zone even when non-Cloudflare NS records exist, and to respect NS records at the + zone apex during outbound zone transfers. + """ + + nameservers: Optional[ZoneDefaultsNameservers] = None + """ + Settings determining the nameservers through which the zone should be available. + """ + + ns_ttl: Optional[float] = None + """The time to live (TTL) of the zone's nameserver (NS) records.""" + + secondary_overrides: Optional[bool] = None + """ + Allows a Secondary DNS zone to use (proxied) override records and CNAME + flattening at the zone apex. + """ + + soa: Optional[ZoneDefaultsSOA] = None + """Components of the zone's SOA record.""" + + zone_mode: Optional[Literal["standard", "cdn_only", "dns_only"]] = None + """Whether the zone mode is a regular or CDN/DNS only zone.""" class SettingEditResponse(BaseModel): - zone_defaults: Optional[DNSSetting] = None + zone_defaults: Optional[ZoneDefaults] = None diff --git a/src/cloudflare/types/dns/setting_get_response.py b/src/cloudflare/types/dns/setting_get_response.py index 42c33600842..778090fdd7a 100644 --- a/src/cloudflare/types/dns/setting_get_response.py +++ b/src/cloudflare/types/dns/setting_get_response.py @@ -1,12 +1,91 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from typing_extensions import Literal from ..._models import BaseModel -from .dns_setting import DNSSetting -__all__ = ["SettingGetResponse"] +__all__ = ["SettingGetResponse", "ZoneDefaults", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] + + +class ZoneDefaultsNameservers(BaseModel): + type: Literal["cloudflare.standard", "cloudflare.standard.random", "custom.account", "custom.tenant"] + """Nameserver type""" + + +class ZoneDefaultsSOA(BaseModel): + expire: float + """ + Time in seconds of being unable to query the primary server after which + secondary servers should stop serving the zone. + """ + + min_ttl: float + """The time to live (TTL) for negative caching of records within the zone.""" + + mname: str + """The primary nameserver, which may be used for outbound zone transfers.""" + + refresh: float + """ + Time in seconds after which secondary servers should re-check the SOA record to + see if the zone has been updated. + """ + + retry: float + """ + Time in seconds after which secondary servers should retry queries after the + primary server was unresponsive. + """ + + rname: str + """ + The email address of the zone administrator, with the first label representing + the local part of the email address. + """ + + ttl: float + """The time to live (TTL) of the SOA record itself.""" + + +class ZoneDefaults(BaseModel): + flatten_all_cnames: Optional[bool] = None + """Whether to flatten all CNAME records in the zone. + + Note that, due to DNS limitations, a CNAME record at the zone apex will always + be flattened. + """ + + foundation_dns: Optional[bool] = None + """Whether to enable Foundation DNS Advanced Nameservers on the zone.""" + + multi_provider: Optional[bool] = None + """ + Whether to enable multi-provider DNS, which causes Cloudflare to activate the + zone even when non-Cloudflare NS records exist, and to respect NS records at the + zone apex during outbound zone transfers. + """ + + nameservers: Optional[ZoneDefaultsNameservers] = None + """ + Settings determining the nameservers through which the zone should be available. + """ + + ns_ttl: Optional[float] = None + """The time to live (TTL) of the zone's nameserver (NS) records.""" + + secondary_overrides: Optional[bool] = None + """ + Allows a Secondary DNS zone to use (proxied) override records and CNAME + flattening at the zone apex. + """ + + soa: Optional[ZoneDefaultsSOA] = None + """Components of the zone's SOA record.""" + + zone_mode: Optional[Literal["standard", "cdn_only", "dns_only"]] = None + """Whether the zone mode is a regular or CDN/DNS only zone.""" class SettingGetResponse(BaseModel): - zone_defaults: Optional[DNSSetting] = None + zone_defaults: Optional[ZoneDefaults] = None