Skip to content

Commit 983a618

Browse files
chore(api): update composite API spec
1 parent f82cfe9 commit 983a618

11 files changed

Lines changed: 65 additions & 34 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 2284
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
3-
openapi_spec_hash: 2c07c63ba9f657089ed5fed8c92bc09c
3+
openapi_spec_hash: de25714eb2cb4cd5f9a5803ac1b921dc
44
config_hash: 3504379ebb14928a9890a391899a2e10

src/cloudflare/resources/zero_trust/api.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,15 +1715,9 @@ Methods:
17151715

17161716
#### Items
17171717

1718-
Types:
1719-
1720-
```python
1721-
from cloudflare.types.zero_trust.gateway.lists import ItemListResponse
1722-
```
1723-
17241718
Methods:
17251719

1726-
- <code title="get /accounts/{account_id}/gateway/lists/{list_id}/items">client.zero_trust.gateway.lists.items.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/items.py">list</a>(list_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/gateway/lists/item_list_response.py">SyncSinglePage[ItemListResponse]</a></code>
1720+
- <code title="get /accounts/{account_id}/gateway/lists/{list_id}/items">client.zero_trust.gateway.lists.items.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/items.py">list</a>(list_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/gateway/gateway_item.py">SyncSinglePage[GatewayItem]</a></code>
17271721

17281722
### Locations
17291723

src/cloudflare/resources/zero_trust/gateway/lists/items.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
)
1717
from .....pagination import SyncSinglePage, AsyncSinglePage
1818
from ....._base_client import AsyncPaginator, make_request_options
19-
from .....types.zero_trust.gateway.lists.item_list_response import ItemListResponse
19+
from .....types.zero_trust.gateway.gateway_item import GatewayItem
2020

2121
__all__ = ["ItemsResource", "AsyncItemsResource"]
2222

@@ -52,7 +52,7 @@ def list(
5252
extra_query: Query | None = None,
5353
extra_body: Body | None = None,
5454
timeout: float | httpx.Timeout | None | NotGiven = not_given,
55-
) -> SyncSinglePage[ItemListResponse]:
55+
) -> SyncSinglePage[GatewayItem]:
5656
"""
5757
Fetch all items in a single Zero Trust list.
5858
@@ -75,11 +75,11 @@ def list(
7575
path_template(
7676
"/accounts/{account_id}/gateway/lists/{list_id}/items", account_id=account_id, list_id=list_id
7777
),
78-
page=SyncSinglePage[ItemListResponse],
78+
page=SyncSinglePage[GatewayItem],
7979
options=make_request_options(
8080
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
8181
),
82-
model=ItemListResponse,
82+
model=GatewayItem,
8383
)
8484

8585

@@ -114,7 +114,7 @@ def list(
114114
extra_query: Query | None = None,
115115
extra_body: Body | None = None,
116116
timeout: float | httpx.Timeout | None | NotGiven = not_given,
117-
) -> AsyncPaginator[ItemListResponse, AsyncSinglePage[ItemListResponse]]:
117+
) -> AsyncPaginator[GatewayItem, AsyncSinglePage[GatewayItem]]:
118118
"""
119119
Fetch all items in a single Zero Trust list.
120120
@@ -137,11 +137,11 @@ def list(
137137
path_template(
138138
"/accounts/{account_id}/gateway/lists/{list_id}/items", account_id=account_id, list_id=list_id
139139
),
140-
page=AsyncSinglePage[ItemListResponse],
140+
page=AsyncSinglePage[GatewayItem],
141141
options=make_request_options(
142142
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
143143
),
144-
model=ItemListResponse,
144+
model=GatewayItem,
145145
)
146146

147147

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_secs: Optional[int] | 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_secs: Specify the maximum TTL, in seconds, applied to DNS response records. Records
86+
whose upstream TTL exceeds this value are served with the capped value. When
87+
null or absent, no cap is applied at this tier.
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_secs": max_ttl_secs,
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_secs: Optional[int] | 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_secs: Specify the maximum TTL, in seconds, applied to DNS response records. Records
165+
whose upstream TTL exceeds this value are served with the capped value. When
166+
null or absent, no cap is applied at this tier.
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_secs": max_ttl_secs,
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_secs: Optional[int] | 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_secs: Specify the maximum TTL, in seconds, applied to DNS response records. Records
386+
whose upstream TTL exceeds this value are served with the capped value. When
387+
null or absent, no cap is applied at this tier.
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_secs": max_ttl_secs,
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_secs: Optional[int] | 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_secs: Specify the maximum TTL, in seconds, applied to DNS response records. Records
465+
whose upstream TTL exceeds this value are served with the capped value. When
466+
null or absent, no cap is applied at this tier.
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_secs": max_ttl_secs,
472496
"networks": networks,
473497
},
474498
location_update_params.LocationUpdateParams,
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from __future__ import annotations
4-
5-
from .item_list_response import ItemListResponse as ItemListResponse

src/cloudflare/types/zero_trust/gateway/lists/item_list_response.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ class Location(BaseModel):
6565
dns_destination_ips_id. This field read-only.
6666
"""
6767

68+
max_ttl_secs: Optional[int] = None
69+
"""
70+
Specify the maximum TTL, in seconds, applied to DNS response records. Records
71+
whose upstream TTL exceeds this value are served with the capped value. When
72+
null or absent, no cap is applied at this tier.
73+
"""
74+
6875
name: Optional[str] = None
6976
"""Specify the location name."""
7077

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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_secs: Optional[int]
38+
"""
39+
Specify the maximum TTL, in seconds, applied to DNS response records. Records
40+
whose upstream TTL exceeds this value are served with the capped value. When
41+
null or absent, no cap is applied at this tier.
42+
"""
43+
3744
networks: Optional[Iterable[Network]]
3845
"""
3946
Specify the list of network ranges from which requests at this location

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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_secs: Optional[int]
38+
"""
39+
Specify the maximum TTL, in seconds, applied to DNS response records. Records
40+
whose upstream TTL exceeds this value are served with the capped value. When
41+
null or absent, no cap is applied at this tier.
42+
"""
43+
3744
networks: Optional[Iterable[Network]]
3845
"""
3946
Specify the list of network ranges from which requests at this location

tests/api_resources/zero_trust/gateway/lists/test_items.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from cloudflare import Cloudflare, AsyncCloudflare
1111
from tests.utils import assert_matches_type
1212
from cloudflare.pagination import SyncSinglePage, AsyncSinglePage
13-
from cloudflare.types.zero_trust.gateway.lists import ItemListResponse
13+
from cloudflare.types.zero_trust.gateway import GatewayItem
1414

1515
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
1616

@@ -24,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None:
2424
list_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
2525
account_id="699d98642c564d2e855e9661899b7252",
2626
)
27-
assert_matches_type(SyncSinglePage[ItemListResponse], item, path=["response"])
27+
assert_matches_type(SyncSinglePage[GatewayItem], item, path=["response"])
2828

2929
@parametrize
3030
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -36,7 +36,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None:
3636
assert response.is_closed is True
3737
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
3838
item = response.parse()
39-
assert_matches_type(SyncSinglePage[ItemListResponse], item, path=["response"])
39+
assert_matches_type(SyncSinglePage[GatewayItem], item, path=["response"])
4040

4141
@parametrize
4242
def test_streaming_response_list(self, client: Cloudflare) -> None:
@@ -48,7 +48,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
4848
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
4949

5050
item = response.parse()
51-
assert_matches_type(SyncSinglePage[ItemListResponse], item, path=["response"])
51+
assert_matches_type(SyncSinglePage[GatewayItem], item, path=["response"])
5252

5353
assert cast(Any, response.is_closed) is True
5454

@@ -78,7 +78,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
7878
list_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
7979
account_id="699d98642c564d2e855e9661899b7252",
8080
)
81-
assert_matches_type(AsyncSinglePage[ItemListResponse], item, path=["response"])
81+
assert_matches_type(AsyncSinglePage[GatewayItem], item, path=["response"])
8282

8383
@parametrize
8484
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -90,7 +90,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
9090
assert response.is_closed is True
9191
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
9292
item = await response.parse()
93-
assert_matches_type(AsyncSinglePage[ItemListResponse], item, path=["response"])
93+
assert_matches_type(AsyncSinglePage[GatewayItem], item, path=["response"])
9494

9595
@parametrize
9696
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
@@ -102,7 +102,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
102102
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
103103

104104
item = await response.parse()
105-
assert_matches_type(AsyncSinglePage[ItemListResponse], item, path=["response"])
105+
assert_matches_type(AsyncSinglePage[GatewayItem], item, path=["response"])
106106

107107
assert cast(Any, response.is_closed) is True
108108

0 commit comments

Comments
 (0)