Skip to content

Commit de12426

Browse files
chore(api): update composite API spec
1 parent cbe0cc6 commit de12426

10 files changed

Lines changed: 153 additions & 13 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 2423
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare/cloudflare-f102c5ba1ae50994067ea9876a7d5e669ec366421f0ec7a74454f60fb0b4d78c.yml
3-
openapi_spec_hash: 23830b1f25fbe7f554b14a742b958536
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare/cloudflare-76a094c7339a3e10d15268d9a00db74f4ea9258cab6829b9dd3542bb0c887ee6.yml
3+
openapi_spec_hash: 85df1a77de03e8d8f5655c0ca4c8e12d
44
config_hash: 87a3db059962c340822a760652737ce0

src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ def edit(
118118
"""
119119
Update (PATCH) a single subcollection of settings such as `antivirus`,
120120
`tls_decrypt`, `activity_log`, `block_page`, `browser_isolation`, `fips`,
121-
`body_scanning`, or `certificate` without updating the entire configuration
122-
object. This endpoint returns an error if any settings collection lacks proper
123-
configuration.
121+
`body_scanning`, `certificate`, or `max_ttl_secs` without updating the entire
122+
configuration object. This endpoint returns an error if any settings collection
123+
lacks proper configuration.
124124
125125
Args:
126126
settings: Specify account settings.
@@ -268,9 +268,9 @@ async def edit(
268268
"""
269269
Update (PATCH) a single subcollection of settings such as `antivirus`,
270270
`tls_decrypt`, `activity_log`, `block_page`, `browser_isolation`, `fips`,
271-
`body_scanning`, or `certificate` without updating the entire configuration
272-
object. This endpoint returns an error if any settings collection lacks proper
273-
configuration.
271+
`body_scanning`, `certificate`, or `max_ttl_secs` without updating the entire
272+
configuration object. This endpoint returns an error if any settings collection
273+
lacks proper configuration.
274274
275275
Args:
276276
settings: Specify account settings.

src/cloudflare/resources/zero_trust/gateway/locations.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def create(
5555
dns_destination_ips_id: str | Omit = omit,
5656
ecs_support: bool | Omit = omit,
5757
endpoints: Optional[EndpointParam] | Omit = omit,
58+
max_ttl: Optional[location_create_params.MaxTTL] | Omit = omit,
5859
networks: Optional[Iterable[location_create_params.Network]] | Omit = omit,
5960
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6061
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -81,6 +82,10 @@ def create(
8182
8283
endpoints: Configure the destination endpoints for this location.
8384
85+
max_ttl: Configure DNS response TTL behavior for this Gateway location. Gateway can
86+
rewrite DNS responses to cap returned record TTLs using the account setting or a
87+
location-specific value, or leave TTLs unchanged.
88+
8489
networks: Specify the list of network ranges from which requests at this location
8590
originate. The list takes effect only if it is non-empty and the IPv4 endpoint
8691
is enabled for this location.
@@ -104,6 +109,7 @@ def create(
104109
"dns_destination_ips_id": dns_destination_ips_id,
105110
"ecs_support": ecs_support,
106111
"endpoints": endpoints,
112+
"max_ttl": max_ttl,
107113
"networks": networks,
108114
},
109115
location_create_params.LocationCreateParams,
@@ -128,6 +134,7 @@ def update(
128134
dns_destination_ips_id: str | Omit = omit,
129135
ecs_support: bool | Omit = omit,
130136
endpoints: Optional[EndpointParam] | Omit = omit,
137+
max_ttl: Optional[location_update_params.MaxTTL] | Omit = omit,
131138
networks: Optional[Iterable[location_update_params.Network]] | Omit = omit,
132139
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
133140
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -154,6 +161,10 @@ def update(
154161
155162
endpoints: Configure the destination endpoints for this location.
156163
164+
max_ttl: Configure DNS response TTL behavior for this Gateway location. Gateway can
165+
rewrite DNS responses to cap returned record TTLs using the account setting or a
166+
location-specific value, or leave TTLs unchanged.
167+
157168
networks: Specify the list of network ranges from which requests at this location
158169
originate. The list takes effect only if it is non-empty and the IPv4 endpoint
159170
is enabled for this location.
@@ -181,6 +192,7 @@ def update(
181192
"dns_destination_ips_id": dns_destination_ips_id,
182193
"ecs_support": ecs_support,
183194
"endpoints": endpoints,
195+
"max_ttl": max_ttl,
184196
"networks": networks,
185197
},
186198
location_update_params.LocationUpdateParams,
@@ -343,6 +355,7 @@ async def create(
343355
dns_destination_ips_id: str | Omit = omit,
344356
ecs_support: bool | Omit = omit,
345357
endpoints: Optional[EndpointParam] | Omit = omit,
358+
max_ttl: Optional[location_create_params.MaxTTL] | Omit = omit,
346359
networks: Optional[Iterable[location_create_params.Network]] | Omit = omit,
347360
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
348361
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -369,6 +382,10 @@ async def create(
369382
370383
endpoints: Configure the destination endpoints for this location.
371384
385+
max_ttl: Configure DNS response TTL behavior for this Gateway location. Gateway can
386+
rewrite DNS responses to cap returned record TTLs using the account setting or a
387+
location-specific value, or leave TTLs unchanged.
388+
372389
networks: Specify the list of network ranges from which requests at this location
373390
originate. The list takes effect only if it is non-empty and the IPv4 endpoint
374391
is enabled for this location.
@@ -392,6 +409,7 @@ async def create(
392409
"dns_destination_ips_id": dns_destination_ips_id,
393410
"ecs_support": ecs_support,
394411
"endpoints": endpoints,
412+
"max_ttl": max_ttl,
395413
"networks": networks,
396414
},
397415
location_create_params.LocationCreateParams,
@@ -416,6 +434,7 @@ async def update(
416434
dns_destination_ips_id: str | Omit = omit,
417435
ecs_support: bool | Omit = omit,
418436
endpoints: Optional[EndpointParam] | Omit = omit,
437+
max_ttl: Optional[location_update_params.MaxTTL] | Omit = omit,
419438
networks: Optional[Iterable[location_update_params.Network]] | Omit = omit,
420439
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
421440
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -442,6 +461,10 @@ async def update(
442461
443462
endpoints: Configure the destination endpoints for this location.
444463
464+
max_ttl: Configure DNS response TTL behavior for this Gateway location. Gateway can
465+
rewrite DNS responses to cap returned record TTLs using the account setting or a
466+
location-specific value, or leave TTLs unchanged.
467+
445468
networks: Specify the list of network ranges from which requests at this location
446469
originate. The list takes effect only if it is non-empty and the IPv4 endpoint
447470
is enabled for this location.
@@ -469,6 +492,7 @@ async def update(
469492
"dns_destination_ips_id": dns_destination_ips_id,
470493
"ecs_support": ecs_support,
471494
"endpoints": endpoints,
495+
"max_ttl": max_ttl,
472496
"networks": networks,
473497
},
474498
location_update_params.LocationUpdateParams,

src/cloudflare/types/zero_trust/gateway/gateway_configuration_settings.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ class GatewayConfigurationSettings(BaseModel):
110110
inspection: Optional[Inspection] = None
111111
"""Define the proxy inspection mode."""
112112

113+
max_ttl_secs: Optional[int] = None
114+
"""Set the account-level DNS TTL cap, in seconds.
115+
116+
Gateway rewrites DNS responses so returned record TTLs do not exceed this value.
117+
DNS locations can inherit, override, or disable this cap.
118+
"""
119+
113120
protocol_detection: Optional[ProtocolDetection] = None
114121
"""Specify whether to detect protocols from the initial bytes of client traffic."""
115122

src/cloudflare/types/zero_trust/gateway/gateway_configuration_settings_param.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ class GatewayConfigurationSettingsParam(TypedDict, total=False):
111111
inspection: Optional[Inspection]
112112
"""Define the proxy inspection mode."""
113113

114+
max_ttl_secs: Optional[int]
115+
"""Set the account-level DNS TTL cap, in seconds.
116+
117+
Gateway rewrites DNS responses so returned record TTLs do not exceed this value.
118+
DNS locations can inherit, override, or disable this cap.
119+
"""
120+
114121
protocol_detection: Optional[ProtocolDetectionParam]
115122
"""Specify whether to detect protocols from the initial bytes of client traffic."""
116123

src/cloudflare/types/zero_trust/gateway/location.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,32 @@
22

33
from typing import List, Optional
44
from datetime import datetime
5+
from typing_extensions import Literal
56

67
from .endpoint import Endpoint
78
from ...._models import BaseModel
89

9-
__all__ = ["Location", "Network"]
10+
__all__ = ["Location", "MaxTTL", "Network"]
11+
12+
13+
class MaxTTL(BaseModel):
14+
"""Configure DNS response TTL behavior for this Gateway location.
15+
16+
Gateway can rewrite DNS responses to cap returned record TTLs using the account setting or a location-specific value, or leave TTLs unchanged.
17+
"""
18+
19+
mode: Literal["inherit", "override", "disabled"]
20+
"""
21+
Specify how this location handles DNS response TTLs by using the account
22+
setting, using a location-specific value, or leaving TTLs unchanged.
23+
"""
24+
25+
ttl_secs: Optional[int] = None
26+
"""Set the location-specific DNS TTL cap, in seconds.
27+
28+
Required when `mode` is `override`. Must be omitted when `mode` is `inherit` or
29+
`disabled`.
30+
"""
1031

1132

1233
class Network(BaseModel):
@@ -65,6 +86,13 @@ class Location(BaseModel):
6586
dns_destination_ips_id. This field read-only.
6687
"""
6788

89+
max_ttl: Optional[MaxTTL] = None
90+
"""Configure DNS response TTL behavior for this Gateway location.
91+
92+
Gateway can rewrite DNS responses to cap returned record TTLs using the account
93+
setting or a location-specific value, or leave TTLs unchanged.
94+
"""
95+
6896
name: Optional[str] = None
6997
"""Specify the location name."""
7098

src/cloudflare/types/zero_trust/gateway/location_create_params.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
from __future__ import annotations
44

55
from typing import Iterable, Optional
6-
from typing_extensions import Required, TypedDict
6+
from typing_extensions import Literal, Required, TypedDict
77

88
from .endpoint_param import EndpointParam
99

10-
__all__ = ["LocationCreateParams", "Network"]
10+
__all__ = ["LocationCreateParams", "MaxTTL", "Network"]
1111

1212

1313
class LocationCreateParams(TypedDict, total=False):
@@ -34,6 +34,13 @@ class LocationCreateParams(TypedDict, total=False):
3434
endpoints: Optional[EndpointParam]
3535
"""Configure the destination endpoints for this location."""
3636

37+
max_ttl: Optional[MaxTTL]
38+
"""Configure DNS response TTL behavior for this Gateway location.
39+
40+
Gateway can rewrite DNS responses to cap returned record TTLs using the account
41+
setting or a location-specific value, or leave TTLs unchanged.
42+
"""
43+
3744
networks: Optional[Iterable[Network]]
3845
"""
3946
Specify the list of network ranges from which requests at this location
@@ -42,6 +49,26 @@ class LocationCreateParams(TypedDict, total=False):
4249
"""
4350

4451

52+
class MaxTTL(TypedDict, total=False):
53+
"""Configure DNS response TTL behavior for this Gateway location.
54+
55+
Gateway can rewrite DNS responses to cap returned record TTLs using the account setting or a location-specific value, or leave TTLs unchanged.
56+
"""
57+
58+
mode: Required[Literal["inherit", "override", "disabled"]]
59+
"""
60+
Specify how this location handles DNS response TTLs by using the account
61+
setting, using a location-specific value, or leaving TTLs unchanged.
62+
"""
63+
64+
ttl_secs: Optional[int]
65+
"""Set the location-specific DNS TTL cap, in seconds.
66+
67+
Required when `mode` is `override`. Must be omitted when `mode` is `inherit` or
68+
`disabled`.
69+
"""
70+
71+
4572
class Network(TypedDict, total=False):
4673
network: Required[str]
4774
"""Specify the IPv4 address or IPv4 CIDR. Limit IPv4 CIDRs to a maximum of /24."""

src/cloudflare/types/zero_trust/gateway/location_update_params.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
from __future__ import annotations
44

55
from typing import Iterable, Optional
6-
from typing_extensions import Required, TypedDict
6+
from typing_extensions import Literal, Required, TypedDict
77

88
from .endpoint_param import EndpointParam
99

10-
__all__ = ["LocationUpdateParams", "Network"]
10+
__all__ = ["LocationUpdateParams", "MaxTTL", "Network"]
1111

1212

1313
class LocationUpdateParams(TypedDict, total=False):
@@ -34,6 +34,13 @@ class LocationUpdateParams(TypedDict, total=False):
3434
endpoints: Optional[EndpointParam]
3535
"""Configure the destination endpoints for this location."""
3636

37+
max_ttl: Optional[MaxTTL]
38+
"""Configure DNS response TTL behavior for this Gateway location.
39+
40+
Gateway can rewrite DNS responses to cap returned record TTLs using the account
41+
setting or a location-specific value, or leave TTLs unchanged.
42+
"""
43+
3744
networks: Optional[Iterable[Network]]
3845
"""
3946
Specify the list of network ranges from which requests at this location
@@ -42,6 +49,26 @@ class LocationUpdateParams(TypedDict, total=False):
4249
"""
4350

4451

52+
class MaxTTL(TypedDict, total=False):
53+
"""Configure DNS response TTL behavior for this Gateway location.
54+
55+
Gateway can rewrite DNS responses to cap returned record TTLs using the account setting or a location-specific value, or leave TTLs unchanged.
56+
"""
57+
58+
mode: Required[Literal["inherit", "override", "disabled"]]
59+
"""
60+
Specify how this location handles DNS response TTLs by using the account
61+
setting, using a location-specific value, or leaving TTLs unchanged.
62+
"""
63+
64+
ttl_secs: Optional[int]
65+
"""Set the location-specific DNS TTL cap, in seconds.
66+
67+
Required when `mode` is `override`. Must be omitted when `mode` is `inherit` or
68+
`disabled`.
69+
"""
70+
71+
4572
class Network(TypedDict, total=False):
4673
network: Required[str]
4774
"""Specify the IPv4 address or IPv4 CIDR. Limit IPv4 CIDRs to a maximum of /24."""

tests/api_resources/zero_trust/gateway/test_configurations.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
7373
"fips": {"tls": True},
7474
"host_selector": {"enabled": False},
7575
"inspection": {"mode": "static"},
76+
"max_ttl_secs": 3600,
7677
"protocol_detection": {"enabled": True},
7778
"sandbox": {
7879
"enabled": True,
@@ -166,6 +167,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
166167
"fips": {"tls": True},
167168
"host_selector": {"enabled": False},
168169
"inspection": {"mode": "static"},
170+
"max_ttl_secs": 3600,
169171
"protocol_detection": {"enabled": True},
170172
"sandbox": {
171173
"enabled": True,
@@ -303,6 +305,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
303305
"fips": {"tls": True},
304306
"host_selector": {"enabled": False},
305307
"inspection": {"mode": "static"},
308+
"max_ttl_secs": 3600,
306309
"protocol_detection": {"enabled": True},
307310
"sandbox": {
308311
"enabled": True,
@@ -396,6 +399,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare)
396399
"fips": {"tls": True},
397400
"host_selector": {"enabled": False},
398401
"inspection": {"mode": "static"},
402+
"max_ttl_secs": 3600,
399403
"protocol_detection": {"enabled": True},
400404
"sandbox": {
401405
"enabled": True,

0 commit comments

Comments
 (0)