Skip to content

Commit bb95823

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#1184)
1 parent 83cd3fd commit bb95823

File tree

10 files changed

+210
-47
lines changed

10 files changed

+210
-47
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1256
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ba6989e092ceb9b2700a5005e1b79d3de9fb5a8abf6d73406bece08a7662171c.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-376cc25a50d22c4ac996448cf4e073f8b1065424b312a46422d1eb663491e28a.yml

api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5496,7 +5496,7 @@ Methods:
54965496
Types:
54975497

54985498
```python
5499-
from cloudflare.types.zero_trust.gateway import Location, LocationNetwork, LocationDeleteResponse
5499+
from cloudflare.types.zero_trust.gateway import Location, LocationDeleteResponse
55005500
```
55015501

55025502
Methods:

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

+44-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from ...._base_client import AsyncPaginator, make_request_options
2525
from ....types.zero_trust.gateway import location_create_params, location_update_params
2626
from ....types.zero_trust.gateway.location import Location
27-
from ....types.zero_trust.gateway.location_network_param import LocationNetworkParam
2827
from ....types.zero_trust.gateway.location_delete_response import LocationDeleteResponse
2928

3029
__all__ = ["LocationsResource", "AsyncLocationsResource"]
@@ -45,8 +44,9 @@ def create(
4544
account_id: str,
4645
name: str,
4746
client_default: bool | NotGiven = NOT_GIVEN,
47+
dns_destination_ips_id: str | NotGiven = NOT_GIVEN,
4848
ecs_support: bool | NotGiven = NOT_GIVEN,
49-
networks: Iterable[LocationNetworkParam] | NotGiven = NOT_GIVEN,
49+
networks: Iterable[location_create_params.Network] | NotGiven = NOT_GIVEN,
5050
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5151
# The extra values given here take precedence over values defined on the client or passed to this method.
5252
extra_headers: Headers | None = None,
@@ -62,9 +62,17 @@ def create(
6262
6363
client_default: True if the location is the default location.
6464
65+
dns_destination_ips_id: The identifier of the pair of IPv4 addresses assigned to this location. When
66+
creating a location, if this field is absent or set with null, the pair of
67+
shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned.
68+
When updating a location, if the field is absent or set with null, the
69+
pre-assigned pair remains unchanged.
70+
6571
ecs_support: True if the location needs to resolve EDNS queries.
6672
6773
networks: A list of network ranges that requests from this location would originate from.
74+
A non-empty list is only effective if the ipv4 endpoint is enabled for this
75+
location.
6876
6977
extra_headers: Send extra headers
7078
@@ -82,6 +90,7 @@ def create(
8290
{
8391
"name": name,
8492
"client_default": client_default,
93+
"dns_destination_ips_id": dns_destination_ips_id,
8594
"ecs_support": ecs_support,
8695
"networks": networks,
8796
},
@@ -104,8 +113,9 @@ def update(
104113
account_id: str,
105114
name: str,
106115
client_default: bool | NotGiven = NOT_GIVEN,
116+
dns_destination_ips_id: str | NotGiven = NOT_GIVEN,
107117
ecs_support: bool | NotGiven = NOT_GIVEN,
108-
networks: Iterable[LocationNetworkParam] | NotGiven = NOT_GIVEN,
118+
networks: Iterable[location_update_params.Network] | NotGiven = NOT_GIVEN,
109119
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
110120
# The extra values given here take precedence over values defined on the client or passed to this method.
111121
extra_headers: Headers | None = None,
@@ -121,9 +131,17 @@ def update(
121131
122132
client_default: True if the location is the default location.
123133
134+
dns_destination_ips_id: The identifier of the pair of IPv4 addresses assigned to this location. When
135+
creating a location, if this field is absent or set with null, the pair of
136+
shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned.
137+
When updating a location, if the field is absent or set with null, the
138+
pre-assigned pair remains unchanged.
139+
124140
ecs_support: True if the location needs to resolve EDNS queries.
125141
126142
networks: A list of network ranges that requests from this location would originate from.
143+
A non-empty list is only effective if the ipv4 endpoint is enabled for this
144+
location.
127145
128146
extra_headers: Send extra headers
129147
@@ -143,6 +161,7 @@ def update(
143161
{
144162
"name": name,
145163
"client_default": client_default,
164+
"dns_destination_ips_id": dns_destination_ips_id,
146165
"ecs_support": ecs_support,
147166
"networks": networks,
148167
},
@@ -293,8 +312,9 @@ async def create(
293312
account_id: str,
294313
name: str,
295314
client_default: bool | NotGiven = NOT_GIVEN,
315+
dns_destination_ips_id: str | NotGiven = NOT_GIVEN,
296316
ecs_support: bool | NotGiven = NOT_GIVEN,
297-
networks: Iterable[LocationNetworkParam] | NotGiven = NOT_GIVEN,
317+
networks: Iterable[location_create_params.Network] | NotGiven = NOT_GIVEN,
298318
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
299319
# The extra values given here take precedence over values defined on the client or passed to this method.
300320
extra_headers: Headers | None = None,
@@ -310,9 +330,17 @@ async def create(
310330
311331
client_default: True if the location is the default location.
312332
333+
dns_destination_ips_id: The identifier of the pair of IPv4 addresses assigned to this location. When
334+
creating a location, if this field is absent or set with null, the pair of
335+
shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned.
336+
When updating a location, if the field is absent or set with null, the
337+
pre-assigned pair remains unchanged.
338+
313339
ecs_support: True if the location needs to resolve EDNS queries.
314340
315341
networks: A list of network ranges that requests from this location would originate from.
342+
A non-empty list is only effective if the ipv4 endpoint is enabled for this
343+
location.
316344
317345
extra_headers: Send extra headers
318346
@@ -330,6 +358,7 @@ async def create(
330358
{
331359
"name": name,
332360
"client_default": client_default,
361+
"dns_destination_ips_id": dns_destination_ips_id,
333362
"ecs_support": ecs_support,
334363
"networks": networks,
335364
},
@@ -352,8 +381,9 @@ async def update(
352381
account_id: str,
353382
name: str,
354383
client_default: bool | NotGiven = NOT_GIVEN,
384+
dns_destination_ips_id: str | NotGiven = NOT_GIVEN,
355385
ecs_support: bool | NotGiven = NOT_GIVEN,
356-
networks: Iterable[LocationNetworkParam] | NotGiven = NOT_GIVEN,
386+
networks: Iterable[location_update_params.Network] | NotGiven = NOT_GIVEN,
357387
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
358388
# The extra values given here take precedence over values defined on the client or passed to this method.
359389
extra_headers: Headers | None = None,
@@ -369,9 +399,17 @@ async def update(
369399
370400
client_default: True if the location is the default location.
371401
402+
dns_destination_ips_id: The identifier of the pair of IPv4 addresses assigned to this location. When
403+
creating a location, if this field is absent or set with null, the pair of
404+
shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned.
405+
When updating a location, if the field is absent or set with null, the
406+
pre-assigned pair remains unchanged.
407+
372408
ecs_support: True if the location needs to resolve EDNS queries.
373409
374410
networks: A list of network ranges that requests from this location would originate from.
411+
A non-empty list is only effective if the ipv4 endpoint is enabled for this
412+
location.
375413
376414
extra_headers: Send extra headers
377415
@@ -391,6 +429,7 @@ async def update(
391429
{
392430
"name": name,
393431
"client_default": client_default,
432+
"dns_destination_ips_id": dns_destination_ips_id,
394433
"ecs_support": ecs_support,
395434
"networks": networks,
396435
},

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

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from .gateway_settings import GatewaySettings as GatewaySettings
2121
from .list_edit_params import ListEditParams as ListEditParams
2222
from .list_list_params import ListListParams as ListListParams
23-
from .location_network import LocationNetwork as LocationNetwork
2423
from .gateway_item_param import GatewayItemParam as GatewayItemParam
2524
from .list_create_params import ListCreateParams as ListCreateParams
2625
from .list_update_params import ListUpdateParams as ListUpdateParams
@@ -40,7 +39,6 @@
4039
from .notification_settings import NotificationSettings as NotificationSettings
4140
from .body_scanning_settings import BodyScanningSettings as BodyScanningSettings
4241
from .location_create_params import LocationCreateParams as LocationCreateParams
43-
from .location_network_param import LocationNetworkParam as LocationNetworkParam
4442
from .location_update_params import LocationUpdateParams as LocationUpdateParams
4543
from .extended_email_matching import ExtendedEmailMatching as ExtendedEmailMatching
4644
from .certificate_get_response import CertificateGetResponse as CertificateGetResponse

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

+118-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,97 @@
44
from datetime import datetime
55

66
from ...._models import BaseModel
7-
from .location_network import LocationNetwork
87

9-
__all__ = ["Location"]
8+
__all__ = [
9+
"Location",
10+
"Endpoints",
11+
"EndpointsDoh",
12+
"EndpointsDohNetwork",
13+
"EndpointsDot",
14+
"EndpointsDotNetwork",
15+
"EndpointsIPV4",
16+
"EndpointsIPV6",
17+
"EndpointsIPV6Network",
18+
"Network",
19+
]
20+
21+
22+
class EndpointsDohNetwork(BaseModel):
23+
network: str
24+
"""The IP address or IP CIDR."""
25+
26+
27+
class EndpointsDoh(BaseModel):
28+
enabled: Optional[bool] = None
29+
"""True if the endpoint is enabled for this location."""
30+
31+
networks: Optional[List[EndpointsDohNetwork]] = None
32+
"""A list of allowed source IP network ranges for this endpoint.
33+
34+
When empty, all source IPs are allowed. A non-empty list is only effective if
35+
the endpoint is enabled for this location.
36+
"""
37+
38+
require_token: Optional[bool] = None
39+
"""
40+
True if the endpoint requires
41+
[user identity](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/agentless/dns/dns-over-https/#filter-doh-requests-by-user)
42+
authentication.
43+
"""
44+
45+
46+
class EndpointsDotNetwork(BaseModel):
47+
network: str
48+
"""The IP address or IP CIDR."""
49+
50+
51+
class EndpointsDot(BaseModel):
52+
enabled: Optional[bool] = None
53+
"""True if the endpoint is enabled for this location."""
54+
55+
networks: Optional[List[EndpointsDotNetwork]] = None
56+
"""A list of allowed source IP network ranges for this endpoint.
57+
58+
When empty, all source IPs are allowed. A non-empty list is only effective if
59+
the endpoint is enabled for this location.
60+
"""
61+
62+
63+
class EndpointsIPV4(BaseModel):
64+
enabled: Optional[bool] = None
65+
"""True if the endpoint is enabled for this location."""
66+
67+
68+
class EndpointsIPV6Network(BaseModel):
69+
network: str
70+
"""The IPv6 address or IPv6 CIDR."""
71+
72+
73+
class EndpointsIPV6(BaseModel):
74+
enabled: Optional[bool] = None
75+
"""True if the endpoint is enabled for this location."""
76+
77+
networks: Optional[List[EndpointsIPV6Network]] = None
78+
"""A list of allowed source IPv6 network ranges for this endpoint.
79+
80+
When empty, all source IPs are allowed. A non-empty list is only effective if
81+
the endpoint is enabled for this location.
82+
"""
83+
84+
85+
class Endpoints(BaseModel):
86+
doh: Optional[EndpointsDoh] = None
87+
88+
dot: Optional[EndpointsDot] = None
89+
90+
ipv4: Optional[EndpointsIPV4] = None
91+
92+
ipv6: Optional[EndpointsIPV6] = None
93+
94+
95+
class Network(BaseModel):
96+
network: str
97+
"""The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24."""
1098

1199

12100
class Location(BaseModel):
@@ -17,6 +105,9 @@ class Location(BaseModel):
17105

18106
created_at: Optional[datetime] = None
19107

108+
dns_destination_ips_id: Optional[str] = None
109+
"""The identifier of the pair of IPv4 addresses assigned to this location."""
110+
20111
doh_subdomain: Optional[str] = None
21112
"""The DNS over HTTPS domain to send DNS requests to.
22113
@@ -26,17 +117,40 @@ class Location(BaseModel):
26117
ecs_support: Optional[bool] = None
27118
"""True if the location needs to resolve EDNS queries."""
28119

120+
endpoints: Optional[Endpoints] = None
121+
"""The destination endpoints configured for this location.
122+
123+
When updating a location, if this field is absent or set with null, the
124+
endpoints configuration remains unchanged.
125+
"""
126+
29127
ip: Optional[str] = None
30128
"""IPV6 destination ip assigned to this location.
31129
32130
DNS requests sent to this IP will counted as the request under this location.
33131
This field is auto-generated by Gateway.
34132
"""
35133

134+
ipv4_destination: Optional[str] = None
135+
"""
136+
The primary destination IPv4 address from the pair identified by the
137+
dns_destination_ips_id. This field is read-only.
138+
"""
139+
140+
ipv4_destination_backup: Optional[str] = None
141+
"""
142+
The backup destination IPv4 address from the pair identified by the
143+
dns_destination_ips_id. This field is read-only.
144+
"""
145+
36146
name: Optional[str] = None
37147
"""The name of the location."""
38148

39-
networks: Optional[List[LocationNetwork]] = None
40-
"""A list of network ranges that requests from this location would originate from."""
149+
networks: Optional[List[Network]] = None
150+
"""A list of network ranges that requests from this location would originate from.
151+
152+
A non-empty list is only effective if the ipv4 endpoint is enabled for this
153+
location.
154+
"""
41155

42156
updated_at: Optional[datetime] = None

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

+21-5
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
from typing import Iterable
66
from typing_extensions import Required, TypedDict
77

8-
from .location_network_param import LocationNetworkParam
9-
10-
__all__ = ["LocationCreateParams"]
8+
__all__ = ["LocationCreateParams", "Network"]
119

1210

1311
class LocationCreateParams(TypedDict, total=False):
@@ -19,8 +17,26 @@ class LocationCreateParams(TypedDict, total=False):
1917
client_default: bool
2018
"""True if the location is the default location."""
2119

20+
dns_destination_ips_id: str
21+
"""The identifier of the pair of IPv4 addresses assigned to this location.
22+
23+
When creating a location, if this field is absent or set with null, the pair of
24+
shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned.
25+
When updating a location, if the field is absent or set with null, the
26+
pre-assigned pair remains unchanged.
27+
"""
28+
2229
ecs_support: bool
2330
"""True if the location needs to resolve EDNS queries."""
2431

25-
networks: Iterable[LocationNetworkParam]
26-
"""A list of network ranges that requests from this location would originate from."""
32+
networks: Iterable[Network]
33+
"""A list of network ranges that requests from this location would originate from.
34+
35+
A non-empty list is only effective if the ipv4 endpoint is enabled for this
36+
location.
37+
"""
38+
39+
40+
class Network(TypedDict, total=False):
41+
network: Required[str]
42+
"""The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24."""

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

-12
This file was deleted.

0 commit comments

Comments
 (0)