Skip to content

Commit 1a7e407

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (cloudflare#1134)
1 parent 7c82074 commit 1a7e407

File tree

6 files changed

+176
-19
lines changed

6 files changed

+176
-19
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4773,7 +4773,6 @@ Methods:
47734773
Types:
47744774

47754775
- <code><a href="./src/resources/zero-trust/gateway/locations.ts">Location</a></code>
4776-
- <code><a href="./src/resources/zero-trust/gateway/locations.ts">LocationNetwork</a></code>
47774776
- <code><a href="./src/resources/zero-trust/gateway/locations.ts">LocationDeleteResponse</a></code>
47784777

47794778
Methods:

src/resources/zero-trust/gateway/gateway.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ export namespace Gateway {
145145
export import ListGetParams = ListsAPI.ListGetParams;
146146
export import Locations = LocationsAPI.Locations;
147147
export import Location = LocationsAPI.Location;
148-
export import LocationNetwork = LocationsAPI.LocationNetwork;
149148
export import LocationDeleteResponse = LocationsAPI.LocationDeleteResponse;
150149
export import LocationsSinglePage = LocationsAPI.LocationsSinglePage;
151150
export import LocationCreateParams = LocationsAPI.LocationCreateParams;

src/resources/zero-trust/gateway/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ export {
9292
} from './audit-ssh-settings';
9393
export {
9494
Location,
95-
LocationNetwork,
9695
LocationDeleteResponse,
9796
LocationCreateParams,
9897
LocationUpdateParams,

src/resources/zero-trust/gateway/locations.ts

Lines changed: 173 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ export interface Location {
9494

9595
created_at?: string;
9696

97+
/**
98+
* The identifier of the pair of IPv4 addresses assigned to this location.
99+
*/
100+
dns_destination_ips_id?: string;
101+
97102
/**
98103
* The DNS over HTTPS domain to send DNS requests to. This field is auto-generated
99104
* by Gateway.
@@ -105,38 +110,154 @@ export interface Location {
105110
*/
106111
ecs_support?: boolean;
107112

113+
/**
114+
* The destination endpoints configured for this location. When updating a
115+
* location, if this field is absent or set with null, the endpoints configuration
116+
* remains unchanged.
117+
*/
118+
endpoints?: Location.Endpoints;
119+
108120
/**
109121
* IPV6 destination ip assigned to this location. DNS requests sent to this IP will
110122
* counted as the request under this location. This field is auto-generated by
111123
* Gateway.
112124
*/
113125
ip?: string;
114126

127+
/**
128+
* The primary destination IPv4 address from the pair identified by the
129+
* dns_destination_ips_id. This field is read-only.
130+
*/
131+
ipv4_destination?: string;
132+
133+
/**
134+
* The backup destination IPv4 address from the pair identified by the
135+
* dns_destination_ips_id. This field is read-only.
136+
*/
137+
ipv4_destination_backup?: string;
138+
115139
/**
116140
* The name of the location.
117141
*/
118142
name?: string;
119143

120144
/**
121145
* A list of network ranges that requests from this location would originate from.
146+
* A non-empty list is only effective if the ipv4 endpoint is enabled for this
147+
* location.
122148
*/
123-
networks?: Array<LocationNetwork>;
149+
networks?: Array<Location.Network>;
124150

125151
updated_at?: string;
126152
}
127153

128-
export interface LocationNetwork {
154+
export namespace Location {
129155
/**
130-
* The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24.
156+
* The destination endpoints configured for this location. When updating a
157+
* location, if this field is absent or set with null, the endpoints configuration
158+
* remains unchanged.
131159
*/
132-
network: string;
133-
}
160+
export interface Endpoints {
161+
doh?: Endpoints.Doh;
134162

135-
export interface LocationNetworkParam {
136-
/**
137-
* The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24.
138-
*/
139-
network: string;
163+
dot?: Endpoints.Dot;
164+
165+
ipv4?: Endpoints.IPV4;
166+
167+
ipv6?: Endpoints.IPV6;
168+
}
169+
170+
export namespace Endpoints {
171+
export interface Doh {
172+
/**
173+
* True if the endpoint is enabled for this location.
174+
*/
175+
enabled?: boolean;
176+
177+
/**
178+
* A list of allowed source IP network ranges for this endpoint. When empty, all
179+
* source IPs are allowed. A non-empty list is only effective if the endpoint is
180+
* enabled for this location.
181+
*/
182+
networks?: Array<Doh.Network>;
183+
184+
/**
185+
* True if the endpoint requires
186+
* [user identity](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/agentless/dns/dns-over-https/#filter-doh-requests-by-user)
187+
* authentication.
188+
*/
189+
require_token?: boolean;
190+
}
191+
192+
export namespace Doh {
193+
export interface Network {
194+
/**
195+
* The IP address or IP CIDR.
196+
*/
197+
network: string;
198+
}
199+
}
200+
201+
export interface Dot {
202+
/**
203+
* True if the endpoint is enabled for this location.
204+
*/
205+
enabled?: boolean;
206+
207+
/**
208+
* A list of allowed source IP network ranges for this endpoint. When empty, all
209+
* source IPs are allowed. A non-empty list is only effective if the endpoint is
210+
* enabled for this location.
211+
*/
212+
networks?: Array<Dot.Network>;
213+
}
214+
215+
export namespace Dot {
216+
export interface Network {
217+
/**
218+
* The IP address or IP CIDR.
219+
*/
220+
network: string;
221+
}
222+
}
223+
224+
export interface IPV4 {
225+
/**
226+
* True if the endpoint is enabled for this location.
227+
*/
228+
enabled?: boolean;
229+
}
230+
231+
export interface IPV6 {
232+
/**
233+
* True if the endpoint is enabled for this location.
234+
*/
235+
enabled?: boolean;
236+
237+
/**
238+
* A list of allowed source IPv6 network ranges for this endpoint. When empty, all
239+
* source IPs are allowed. A non-empty list is only effective if the endpoint is
240+
* enabled for this location.
241+
*/
242+
networks?: Array<IPV6.Network>;
243+
}
244+
245+
export namespace IPV6 {
246+
export interface Network {
247+
/**
248+
* The IPv6 address or IPv6 CIDR.
249+
*/
250+
network: string;
251+
}
252+
}
253+
}
254+
255+
export interface Network {
256+
/**
257+
* The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24.
258+
*/
259+
network: string;
260+
}
140261
}
141262

142263
export type LocationDeleteResponse = unknown | string | null;
@@ -157,16 +278,35 @@ export interface LocationCreateParams {
157278
*/
158279
client_default?: boolean;
159280

281+
/**
282+
* Body param: The identifier of the pair of IPv4 addresses assigned to this
283+
* location. When creating a location, if this field is absent or set with null,
284+
* the pair of shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is
285+
* auto-assigned. When updating a location, if the field is absent or set with
286+
* null, the pre-assigned pair remains unchanged.
287+
*/
288+
dns_destination_ips_id?: string;
289+
160290
/**
161291
* Body param: True if the location needs to resolve EDNS queries.
162292
*/
163293
ecs_support?: boolean;
164294

165295
/**
166296
* Body param: A list of network ranges that requests from this location would
167-
* originate from.
297+
* originate from. A non-empty list is only effective if the ipv4 endpoint is
298+
* enabled for this location.
168299
*/
169-
networks?: Array<LocationNetworkParam>;
300+
networks?: Array<LocationCreateParams.Network>;
301+
}
302+
303+
export namespace LocationCreateParams {
304+
export interface Network {
305+
/**
306+
* The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24.
307+
*/
308+
network: string;
309+
}
170310
}
171311

172312
export interface LocationUpdateParams {
@@ -185,16 +325,35 @@ export interface LocationUpdateParams {
185325
*/
186326
client_default?: boolean;
187327

328+
/**
329+
* Body param: The identifier of the pair of IPv4 addresses assigned to this
330+
* location. When creating a location, if this field is absent or set with null,
331+
* the pair of shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is
332+
* auto-assigned. When updating a location, if the field is absent or set with
333+
* null, the pre-assigned pair remains unchanged.
334+
*/
335+
dns_destination_ips_id?: string;
336+
188337
/**
189338
* Body param: True if the location needs to resolve EDNS queries.
190339
*/
191340
ecs_support?: boolean;
192341

193342
/**
194343
* Body param: A list of network ranges that requests from this location would
195-
* originate from.
344+
* originate from. A non-empty list is only effective if the ipv4 endpoint is
345+
* enabled for this location.
196346
*/
197-
networks?: Array<LocationNetworkParam>;
347+
networks?: Array<LocationUpdateParams.Network>;
348+
}
349+
350+
export namespace LocationUpdateParams {
351+
export interface Network {
352+
/**
353+
* The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24.
354+
*/
355+
network: string;
356+
}
198357
}
199358

200359
export interface LocationListParams {
@@ -211,7 +370,6 @@ export interface LocationGetParams {
211370

212371
export namespace Locations {
213372
export import Location = LocationsAPI.Location;
214-
export import LocationNetwork = LocationsAPI.LocationNetwork;
215373
export import LocationDeleteResponse = LocationsAPI.LocationDeleteResponse;
216374
export import LocationsSinglePage = LocationsAPI.LocationsSinglePage;
217375
export import LocationCreateParams = LocationsAPI.LocationCreateParams;

tests/api-resources/zero-trust/gateway/locations.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ describe('resource locations', () => {
2929
account_id: '699d98642c564d2e855e9661899b7252',
3030
name: 'Austin Office Location',
3131
client_default: false,
32+
dns_destination_ips_id: '0e4a32c6-6fb8-4858-9296-98f51631e8e6',
3233
ecs_support: false,
3334
networks: [{ network: '192.0.2.1/32' }, { network: '192.0.2.1/32' }, { network: '192.0.2.1/32' }],
3435
});
@@ -53,6 +54,7 @@ describe('resource locations', () => {
5354
account_id: '699d98642c564d2e855e9661899b7252',
5455
name: 'Austin Office Location',
5556
client_default: false,
57+
dns_destination_ips_id: '0e4a32c6-6fb8-4858-9296-98f51631e8e6',
5658
ecs_support: false,
5759
networks: [{ network: '192.0.2.1/32' }, { network: '192.0.2.1/32' }, { network: '192.0.2.1/32' }],
5860
});

0 commit comments

Comments
 (0)