diff --git a/.stats.yml b/.stats.yml index 8e47fa9598b..389fe251734 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1335 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1a0beb27a59a3abb36f2931ebc3fc1bcbf0f91a8da100fc87d2254a85549879b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-13157b0171e236329a3811eedbce4e5b71b517be66de1126b5dcb6ac4b964ee6.yml diff --git a/src/cloudflare/resources/zones/dns_settings.py b/src/cloudflare/resources/zones/dns_settings.py index 6da4a2d86ff..072889b3538 100644 --- a/src/cloudflare/resources/zones/dns_settings.py +++ b/src/cloudflare/resources/zones/dns_settings.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Type, Optional, cast +from typing_extensions import Literal import httpx @@ -46,7 +47,10 @@ def edit( foundation_dns: bool | NotGiven = NOT_GIVEN, multi_provider: bool | NotGiven = NOT_GIVEN, nameservers: NameserverParam | NotGiven = NOT_GIVEN, + ns_ttl: float | NotGiven = NOT_GIVEN, secondary_overrides: bool | NotGiven = NOT_GIVEN, + soa: dns_setting_edit_params.Soa | NotGiven = NOT_GIVEN, + zone_mode: Literal["standard", "cdn_only", "dns_only"] | 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, @@ -68,9 +72,15 @@ def edit( nameservers: Settings determining the nameservers through which the zone should be available. + ns_ttl: The time to live (TTL) of the zone's nameserver (NS) records. + secondary_overrides: Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex. + soa: Components of the zone's SOA record. + + zone_mode: Whether the zone mode is a regular or CDN/DNS only zone. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -88,7 +98,10 @@ def edit( "foundation_dns": foundation_dns, "multi_provider": multi_provider, "nameservers": nameservers, + "ns_ttl": ns_ttl, "secondary_overrides": secondary_overrides, + "soa": soa, + "zone_mode": zone_mode, }, dns_setting_edit_params.DNSSettingEditParams, ), @@ -158,7 +171,10 @@ async def edit( foundation_dns: bool | NotGiven = NOT_GIVEN, multi_provider: bool | NotGiven = NOT_GIVEN, nameservers: NameserverParam | NotGiven = NOT_GIVEN, + ns_ttl: float | NotGiven = NOT_GIVEN, secondary_overrides: bool | NotGiven = NOT_GIVEN, + soa: dns_setting_edit_params.Soa | NotGiven = NOT_GIVEN, + zone_mode: Literal["standard", "cdn_only", "dns_only"] | 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, @@ -180,9 +196,15 @@ async def edit( nameservers: Settings determining the nameservers through which the zone should be available. + ns_ttl: The time to live (TTL) of the zone's nameserver (NS) records. + secondary_overrides: Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex. + soa: Components of the zone's SOA record. + + zone_mode: Whether the zone mode is a regular or CDN/DNS only zone. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -200,7 +222,10 @@ async def edit( "foundation_dns": foundation_dns, "multi_provider": multi_provider, "nameservers": nameservers, + "ns_ttl": ns_ttl, "secondary_overrides": secondary_overrides, + "soa": soa, + "zone_mode": zone_mode, }, dns_setting_edit_params.DNSSettingEditParams, ), diff --git a/src/cloudflare/types/zones/dns_setting.py b/src/cloudflare/types/zones/dns_setting.py index ea337af7a25..81ac77cb2cd 100644 --- a/src/cloudflare/types/zones/dns_setting.py +++ b/src/cloudflare/types/zones/dns_setting.py @@ -1,11 +1,47 @@ # 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"] +__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): @@ -24,8 +60,17 @@ class DNSSetting(BaseModel): 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/zones/dns_setting_edit_params.py b/src/cloudflare/types/zones/dns_setting_edit_params.py index fa2cdb1dca2..431cafab4c0 100644 --- a/src/cloudflare/types/zones/dns_setting_edit_params.py +++ b/src/cloudflare/types/zones/dns_setting_edit_params.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict from .nameserver_param import NameserverParam -__all__ = ["DNSSettingEditParams"] +__all__ = ["DNSSettingEditParams", "Soa"] class DNSSettingEditParams(TypedDict, total=False): @@ -28,8 +28,52 @@ class DNSSettingEditParams(TypedDict, total=False): 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.""" + + +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.""" diff --git a/tests/api_resources/zones/test_dns_settings.py b/tests/api_resources/zones/test_dns_settings.py index d9df4b018c9..db759678ffa 100644 --- a/tests/api_resources/zones/test_dns_settings.py +++ b/tests/api_resources/zones/test_dns_settings.py @@ -31,7 +31,18 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: foundation_dns=False, multi_provider=False, nameservers={"type": "cloudflare.standard"}, + ns_ttl=86400, secondary_overrides=False, + soa={ + "expire": 604800, + "min_ttl": 1800, + "mname": "kristina.ns.cloudflare.com", + "refresh": 10000, + "retry": 2400, + "rname": "admin.example.com", + "ttl": 3600, + }, + zone_mode="dns_only", ) assert_matches_type(Optional[DNSSetting], dns_setting, path=["response"]) @@ -122,7 +133,18 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) foundation_dns=False, multi_provider=False, nameservers={"type": "cloudflare.standard"}, + ns_ttl=86400, secondary_overrides=False, + soa={ + "expire": 604800, + "min_ttl": 1800, + "mname": "kristina.ns.cloudflare.com", + "refresh": 10000, + "retry": 2400, + "rname": "admin.example.com", + "ttl": 3600, + }, + zone_mode="dns_only", ) assert_matches_type(Optional[DNSSetting], dns_setting, path=["response"])