Skip to content

Commit 944d006

Browse files
chore(api): update composite API spec
1 parent 791b094 commit 944d006

File tree

7 files changed

+466
-4
lines changed

7 files changed

+466
-4
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1808
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e11072d54af1a97bdf55e897aa3cd89b3730d597e5801b21e933fa0fa67cb45a.yml
3-
openapi_spec_hash: 84c0f97290c485bf1d38a71caf560611
4-
config_hash: ac39502fa4e8d68adc46abde8cfd2af4
1+
configured_endpoints: 1813
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-215613c33dac79b41951b498eadbc04d0f0c27baad1281987f49fab8cde90955.yml
3+
openapi_spec_hash: 14ef51115b228cc64a904446d6de88cf
4+
config_hash: 894460b179fd16a47a415e4b02f874c0

api.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6151,6 +6151,20 @@ Methods:
61516151

61526152
- <code title="patch /accounts/{account_id}/zerotrust/subnets/cloudflare_source/{address_family}">client.zeroTrust.networks.subnets.cloudflareSource.<a href="./src/resources/zero-trust/networks/subnets/cloudflare-source.ts">update</a>(addressFamily, { ...params }) -> CloudflareSourceUpdateResponse</code>
61536153

6154+
### HostnameRoutes
6155+
6156+
Types:
6157+
6158+
- <code><a href="./src/resources/zero-trust/networks/hostname-routes.ts">HostnameRoute</a></code>
6159+
6160+
Methods:
6161+
6162+
- <code title="post /accounts/{account_id}/zerotrust/routes/hostname">client.zeroTrust.networks.hostnameRoutes.<a href="./src/resources/zero-trust/networks/hostname-routes.ts">create</a>({ ...params }) -> HostnameRoute</code>
6163+
- <code title="get /accounts/{account_id}/zerotrust/routes/hostname">client.zeroTrust.networks.hostnameRoutes.<a href="./src/resources/zero-trust/networks/hostname-routes.ts">list</a>({ ...params }) -> HostnameRoutesV4PagePaginationArray</code>
6164+
- <code title="delete /accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}">client.zeroTrust.networks.hostnameRoutes.<a href="./src/resources/zero-trust/networks/hostname-routes.ts">delete</a>(hostnameRouteId, { ...params }) -> HostnameRoute</code>
6165+
- <code title="patch /accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}">client.zeroTrust.networks.hostnameRoutes.<a href="./src/resources/zero-trust/networks/hostname-routes.ts">edit</a>(hostnameRouteId, { ...params }) -> HostnameRoute</code>
6166+
- <code title="get /accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}">client.zeroTrust.networks.hostnameRoutes.<a href="./src/resources/zero-trust/networks/hostname-routes.ts">get</a>(hostnameRouteId, { ...params }) -> HostnameRoute</code>
6167+
61546168
## RiskScoring
61556169

61566170
Types:

scripts/detect-breaking-changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ TEST_PATHS=(
517517
tests/api-resources/zero-trust/networks/virtual-networks.test.ts
518518
tests/api-resources/zero-trust/networks/subnets/subnets.test.ts
519519
tests/api-resources/zero-trust/networks/subnets/cloudflare-source.test.ts
520+
tests/api-resources/zero-trust/networks/hostname-routes.test.ts
520521
tests/api-resources/zero-trust/risk-scoring/risk-scoring.test.ts
521522
tests/api-resources/zero-trust/risk-scoring/behaviours.test.ts
522523
tests/api-resources/zero-trust/risk-scoring/summary.test.ts
Lines changed: 283 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,283 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from '../../../resource';
4+
import * as Core from '../../../core';
5+
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination';
6+
7+
export class HostnameRoutes extends APIResource {
8+
/**
9+
* Create a hostname route.
10+
*
11+
* @example
12+
* ```ts
13+
* const hostnameRoute =
14+
* await client.zeroTrust.networks.hostnameRoutes.create({
15+
* account_id: '699d98642c564d2e855e9661899b7252',
16+
* });
17+
* ```
18+
*/
19+
create(params: HostnameRouteCreateParams, options?: Core.RequestOptions): Core.APIPromise<HostnameRoute> {
20+
const { account_id, ...body } = params;
21+
return (
22+
this._client.post(`/accounts/${account_id}/zerotrust/routes/hostname`, {
23+
body,
24+
...options,
25+
}) as Core.APIPromise<{ result: HostnameRoute }>
26+
)._thenUnwrap((obj) => obj.result);
27+
}
28+
29+
/**
30+
* Lists and filters hostname routes in an account.
31+
*
32+
* @example
33+
* ```ts
34+
* // Automatically fetches more pages as needed.
35+
* for await (const hostnameRoute of client.zeroTrust.networks.hostnameRoutes.list(
36+
* { account_id: '699d98642c564d2e855e9661899b7252' },
37+
* )) {
38+
* // ...
39+
* }
40+
* ```
41+
*/
42+
list(
43+
params: HostnameRouteListParams,
44+
options?: Core.RequestOptions,
45+
): Core.PagePromise<HostnameRoutesV4PagePaginationArray, HostnameRoute> {
46+
const { account_id, ...query } = params;
47+
return this._client.getAPIList(
48+
`/accounts/${account_id}/zerotrust/routes/hostname`,
49+
HostnameRoutesV4PagePaginationArray,
50+
{ query, ...options },
51+
);
52+
}
53+
54+
/**
55+
* Delete a hostname route.
56+
*
57+
* @example
58+
* ```ts
59+
* const hostnameRoute =
60+
* await client.zeroTrust.networks.hostnameRoutes.delete(
61+
* 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
62+
* { account_id: '699d98642c564d2e855e9661899b7252' },
63+
* );
64+
* ```
65+
*/
66+
delete(
67+
hostnameRouteId: string,
68+
params: HostnameRouteDeleteParams,
69+
options?: Core.RequestOptions,
70+
): Core.APIPromise<HostnameRoute> {
71+
const { account_id } = params;
72+
return (
73+
this._client.delete(
74+
`/accounts/${account_id}/zerotrust/routes/hostname/${hostnameRouteId}`,
75+
options,
76+
) as Core.APIPromise<{ result: HostnameRoute }>
77+
)._thenUnwrap((obj) => obj.result);
78+
}
79+
80+
/**
81+
* Updates a hostname route.
82+
*
83+
* @example
84+
* ```ts
85+
* const hostnameRoute =
86+
* await client.zeroTrust.networks.hostnameRoutes.edit(
87+
* 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
88+
* { account_id: '699d98642c564d2e855e9661899b7252' },
89+
* );
90+
* ```
91+
*/
92+
edit(
93+
hostnameRouteId: string,
94+
params: HostnameRouteEditParams,
95+
options?: Core.RequestOptions,
96+
): Core.APIPromise<HostnameRoute> {
97+
const { account_id, ...body } = params;
98+
return (
99+
this._client.patch(`/accounts/${account_id}/zerotrust/routes/hostname/${hostnameRouteId}`, {
100+
body,
101+
...options,
102+
}) as Core.APIPromise<{ result: HostnameRoute }>
103+
)._thenUnwrap((obj) => obj.result);
104+
}
105+
106+
/**
107+
* Get a hostname route.
108+
*
109+
* @example
110+
* ```ts
111+
* const hostnameRoute =
112+
* await client.zeroTrust.networks.hostnameRoutes.get(
113+
* 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
114+
* { account_id: '699d98642c564d2e855e9661899b7252' },
115+
* );
116+
* ```
117+
*/
118+
get(
119+
hostnameRouteId: string,
120+
params: HostnameRouteGetParams,
121+
options?: Core.RequestOptions,
122+
): Core.APIPromise<HostnameRoute> {
123+
const { account_id } = params;
124+
return (
125+
this._client.get(
126+
`/accounts/${account_id}/zerotrust/routes/hostname/${hostnameRouteId}`,
127+
options,
128+
) as Core.APIPromise<{ result: HostnameRoute }>
129+
)._thenUnwrap((obj) => obj.result);
130+
}
131+
}
132+
133+
export class HostnameRoutesV4PagePaginationArray extends V4PagePaginationArray<HostnameRoute> {}
134+
135+
export interface HostnameRoute {
136+
/**
137+
* The hostname route ID.
138+
*/
139+
id?: string;
140+
141+
/**
142+
* An optional description of the hostname route.
143+
*/
144+
comment?: string;
145+
146+
/**
147+
* Timestamp of when the resource was created.
148+
*/
149+
created_at?: string;
150+
151+
/**
152+
* Timestamp of when the resource was deleted. If `null`, the resource has not been
153+
* deleted.
154+
*/
155+
deleted_at?: string;
156+
157+
/**
158+
* The hostname of the route.
159+
*/
160+
hostname?: string;
161+
162+
/**
163+
* UUID of the tunnel.
164+
*/
165+
tunnel_id?: string;
166+
167+
/**
168+
* A user-friendly name for a tunnel.
169+
*/
170+
tunnel_name?: string;
171+
}
172+
173+
export interface HostnameRouteCreateParams {
174+
/**
175+
* Path param: Cloudflare account ID
176+
*/
177+
account_id: string;
178+
179+
/**
180+
* Body param: An optional description of the hostname route.
181+
*/
182+
comment?: string;
183+
184+
/**
185+
* Body param: The hostname of the route.
186+
*/
187+
hostname?: string;
188+
189+
/**
190+
* Body param: UUID of the tunnel.
191+
*/
192+
tunnel_id?: string;
193+
}
194+
195+
export interface HostnameRouteListParams extends V4PagePaginationArrayParams {
196+
/**
197+
* Path param: Cloudflare account ID
198+
*/
199+
account_id: string;
200+
201+
/**
202+
* Query param: The hostname route ID.
203+
*/
204+
id?: string;
205+
206+
/**
207+
* Query param: If set, only list hostname routes with the given comment.
208+
*/
209+
comment?: string;
210+
211+
/**
212+
* Query param: If provided, include only resources that were created (and not
213+
* deleted) before this time. URL encoded.
214+
*/
215+
existed_at?: string;
216+
217+
/**
218+
* Query param: If set, only list hostname routes that contain a substring of the
219+
* given value, the filter is case-insensitive.
220+
*/
221+
hostname?: string;
222+
223+
/**
224+
* Query param: If `true`, only return deleted hostname routes. If `false`, exclude
225+
* deleted hostname routes.
226+
*/
227+
is_deleted?: boolean;
228+
229+
/**
230+
* Query param: If set, only list hostname routes that point to a specific tunnel.
231+
*/
232+
tunnel_id?: string;
233+
}
234+
235+
export interface HostnameRouteDeleteParams {
236+
/**
237+
* Cloudflare account ID
238+
*/
239+
account_id: string;
240+
}
241+
242+
export interface HostnameRouteEditParams {
243+
/**
244+
* Path param: Cloudflare account ID
245+
*/
246+
account_id: string;
247+
248+
/**
249+
* Body param: An optional description of the hostname route.
250+
*/
251+
comment?: string;
252+
253+
/**
254+
* Body param: The hostname of the route.
255+
*/
256+
hostname?: string;
257+
258+
/**
259+
* Body param: UUID of the tunnel.
260+
*/
261+
tunnel_id?: string;
262+
}
263+
264+
export interface HostnameRouteGetParams {
265+
/**
266+
* Cloudflare account ID
267+
*/
268+
account_id: string;
269+
}
270+
271+
HostnameRoutes.HostnameRoutesV4PagePaginationArray = HostnameRoutesV4PagePaginationArray;
272+
273+
export declare namespace HostnameRoutes {
274+
export {
275+
type HostnameRoute as HostnameRoute,
276+
HostnameRoutesV4PagePaginationArray as HostnameRoutesV4PagePaginationArray,
277+
type HostnameRouteCreateParams as HostnameRouteCreateParams,
278+
type HostnameRouteListParams as HostnameRouteListParams,
279+
type HostnameRouteDeleteParams as HostnameRouteDeleteParams,
280+
type HostnameRouteEditParams as HostnameRouteEditParams,
281+
type HostnameRouteGetParams as HostnameRouteGetParams,
282+
};
283+
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
export {
4+
HostnameRoutesV4PagePaginationArray,
5+
HostnameRoutes,
6+
type HostnameRoute,
7+
type HostnameRouteCreateParams,
8+
type HostnameRouteListParams,
9+
type HostnameRouteDeleteParams,
10+
type HostnameRouteEditParams,
11+
type HostnameRouteGetParams,
12+
} from './hostname-routes';
313
export { Networks } from './networks';
414
export {
515
SubnetListResponsesV4PagePaginationArray,

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../../../resource';
4+
import * as HostnameRoutesAPI from './hostname-routes';
5+
import {
6+
HostnameRoute,
7+
HostnameRouteCreateParams,
8+
HostnameRouteDeleteParams,
9+
HostnameRouteEditParams,
10+
HostnameRouteGetParams,
11+
HostnameRouteListParams,
12+
HostnameRoutes,
13+
HostnameRoutesV4PagePaginationArray,
14+
} from './hostname-routes';
415
import * as VirtualNetworksAPI from './virtual-networks';
516
import {
617
VirtualNetwork,
@@ -37,6 +48,7 @@ export class Networks extends APIResource {
3748
routes: RoutesAPI.Routes = new RoutesAPI.Routes(this._client);
3849
virtualNetworks: VirtualNetworksAPI.VirtualNetworks = new VirtualNetworksAPI.VirtualNetworks(this._client);
3950
subnets: SubnetsAPI.Subnets = new SubnetsAPI.Subnets(this._client);
51+
hostnameRoutes: HostnameRoutesAPI.HostnameRoutes = new HostnameRoutesAPI.HostnameRoutes(this._client);
4052
}
4153

4254
Networks.Routes = Routes;
@@ -45,6 +57,8 @@ Networks.VirtualNetworks = VirtualNetworks;
4557
Networks.VirtualNetworksSinglePage = VirtualNetworksSinglePage;
4658
Networks.Subnets = Subnets;
4759
Networks.SubnetListResponsesV4PagePaginationArray = SubnetListResponsesV4PagePaginationArray;
60+
Networks.HostnameRoutes = HostnameRoutes;
61+
Networks.HostnameRoutesV4PagePaginationArray = HostnameRoutesV4PagePaginationArray;
4862

4963
export declare namespace Networks {
5064
export {
@@ -77,4 +91,15 @@ export declare namespace Networks {
7791
SubnetListResponsesV4PagePaginationArray as SubnetListResponsesV4PagePaginationArray,
7892
type SubnetListParams as SubnetListParams,
7993
};
94+
95+
export {
96+
HostnameRoutes as HostnameRoutes,
97+
type HostnameRoute as HostnameRoute,
98+
HostnameRoutesV4PagePaginationArray as HostnameRoutesV4PagePaginationArray,
99+
type HostnameRouteCreateParams as HostnameRouteCreateParams,
100+
type HostnameRouteListParams as HostnameRouteListParams,
101+
type HostnameRouteDeleteParams as HostnameRouteDeleteParams,
102+
type HostnameRouteEditParams as HostnameRouteEditParams,
103+
type HostnameRouteGetParams as HostnameRouteGetParams,
104+
};
80105
}

0 commit comments

Comments
 (0)