Skip to content

Commit 33459bb

Browse files
chore(api): update composite API spec
1 parent b061917 commit 33459bb

File tree

4 files changed

+119
-59
lines changed

4 files changed

+119
-59
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1891
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9bfdd2b4c315a73926fbeb38dc2c52b4bd9997f94136e4cf0c9d6a7ecec6d61c.yml
3-
openapi_spec_hash: 1f14d58ffd5de7eb8026e0745c2a0b7c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5fb72c1d1363fe41d61412dbd64995c501ab30fe1e2c63d194515ce905239b4a.yml
3+
openapi_spec_hash: 00b11bf03f53e7c9f4680767d339bce0
44
config_hash: f02bc3ad56bdede6c515f996ca86012c

api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6121,10 +6121,10 @@ Types:
61216121
Methods:
61226122

61236123
- <code title="post /accounts/{account_id}/gateway/proxy_endpoints">client.zeroTrust.gateway.proxyEndpoints.<a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">create</a>({ ...params }) -> ProxyEndpoint</code>
6124-
- <code title="get /accounts/{account_id}/gateway/proxy_endpoints">client.zeroTrust.gateway.proxyEndpoints.<a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">list</a>({ ...params }) -> ProxyEndpoint</code>
6124+
- <code title="get /accounts/{account_id}/gateway/proxy_endpoints">client.zeroTrust.gateway.proxyEndpoints.<a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">list</a>({ ...params }) -> ProxyEndpointsSinglePage</code>
61256125
- <code title="delete /accounts/{account_id}/gateway/proxy_endpoints/{proxy_endpoint_id}">client.zeroTrust.gateway.proxyEndpoints.<a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">delete</a>(proxyEndpointId, { ...params }) -> ProxyEndpointDeleteResponse</code>
61266126
- <code title="patch /accounts/{account_id}/gateway/proxy_endpoints/{proxy_endpoint_id}">client.zeroTrust.gateway.proxyEndpoints.<a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">edit</a>(proxyEndpointId, { ...params }) -> ProxyEndpoint</code>
6127-
- <code title="get /accounts/{account_id}/gateway/proxy_endpoints/{proxy_endpoint_id}">client.zeroTrust.gateway.proxyEndpoints.<a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">get</a>(proxyEndpointId, { ...params }) -> ProxyEndpointsSinglePage</code>
6127+
- <code title="get /accounts/{account_id}/gateway/proxy_endpoints/{proxy_endpoint_id}">client.zeroTrust.gateway.proxyEndpoints.<a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">get</a>(proxyEndpointId, { ...params }) -> ProxyEndpoint</code>
61286128

61296129
### Rules
61306130

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

Lines changed: 114 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { APIResource } from '../../../resource';
44
import * as Core from '../../../core';
5+
import * as ProxyEndpointsAPI from './proxy-endpoints';
56
import { SinglePage } from '../../../pagination';
67

78
export class ProxyEndpoints extends APIResource {
@@ -13,7 +14,6 @@ export class ProxyEndpoints extends APIResource {
1314
* const proxyEndpoint =
1415
* await client.zeroTrust.gateway.proxyEndpoints.create({
1516
* account_id: '699d98642c564d2e855e9661899b7252',
16-
* ips: ['192.0.2.1/32'],
1717
* name: 'Devops team',
1818
* });
1919
* ```
@@ -33,19 +33,24 @@ export class ProxyEndpoints extends APIResource {
3333
*
3434
* @example
3535
* ```ts
36-
* const proxyEndpoint =
37-
* await client.zeroTrust.gateway.proxyEndpoints.list({
38-
* account_id: '699d98642c564d2e855e9661899b7252',
39-
* });
36+
* // Automatically fetches more pages as needed.
37+
* for await (const proxyEndpoint of client.zeroTrust.gateway.proxyEndpoints.list(
38+
* { account_id: '699d98642c564d2e855e9661899b7252' },
39+
* )) {
40+
* // ...
41+
* }
4042
* ```
4143
*/
42-
list(params: ProxyEndpointListParams, options?: Core.RequestOptions): Core.APIPromise<ProxyEndpoint> {
44+
list(
45+
params: ProxyEndpointListParams,
46+
options?: Core.RequestOptions,
47+
): Core.PagePromise<ProxyEndpointsSinglePage, ProxyEndpoint> {
4348
const { account_id } = params;
44-
return (
45-
this._client.get(`/accounts/${account_id}/gateway/proxy_endpoints`, options) as Core.APIPromise<{
46-
result: ProxyEndpoint;
47-
}>
48-
)._thenUnwrap((obj) => obj.result);
49+
return this._client.getAPIList(
50+
`/accounts/${account_id}/gateway/proxy_endpoints`,
51+
ProxyEndpointsSinglePage,
52+
options,
53+
);
4954
}
5055

5156
/**
@@ -105,26 +110,25 @@ export class ProxyEndpoints extends APIResource {
105110
*
106111
* @example
107112
* ```ts
108-
* // Automatically fetches more pages as needed.
109-
* for await (const proxyEndpoint of client.zeroTrust.gateway.proxyEndpoints.get(
110-
* 'ed35569b41ce4d1facfe683550f54086',
111-
* { account_id: '699d98642c564d2e855e9661899b7252' },
112-
* )) {
113-
* // ...
114-
* }
113+
* const proxyEndpoint =
114+
* await client.zeroTrust.gateway.proxyEndpoints.get(
115+
* 'ed35569b41ce4d1facfe683550f54086',
116+
* { account_id: '699d98642c564d2e855e9661899b7252' },
117+
* );
115118
* ```
116119
*/
117120
get(
118121
proxyEndpointId: string,
119122
params: ProxyEndpointGetParams,
120123
options?: Core.RequestOptions,
121-
): Core.PagePromise<ProxyEndpointsSinglePage, ProxyEndpoint> {
124+
): Core.APIPromise<ProxyEndpoint> {
122125
const { account_id } = params;
123-
return this._client.getAPIList(
124-
`/accounts/${account_id}/gateway/proxy_endpoints/${proxyEndpointId}`,
125-
ProxyEndpointsSinglePage,
126-
options,
127-
);
126+
return (
127+
this._client.get(
128+
`/accounts/${account_id}/gateway/proxy_endpoints/${proxyEndpointId}`,
129+
options,
130+
) as Core.APIPromise<{ result: ProxyEndpoint }>
131+
)._thenUnwrap((obj) => obj.result);
128132
}
129133
}
130134

@@ -142,46 +146,103 @@ export type GatewayIPs = string;
142146
*/
143147
export type GatewayIPsParam = string;
144148

145-
export interface ProxyEndpoint {
146-
id?: string;
149+
export type ProxyEndpoint =
150+
| ProxyEndpoint.ZeroTrustGatewayProxyEndpointIP
151+
| ProxyEndpoint.ZeroTrustGatewayProxyEndpointIdentity;
147152

148-
created_at?: string;
153+
export namespace ProxyEndpoint {
154+
export interface ZeroTrustGatewayProxyEndpointIP {
155+
/**
156+
* Specify the list of CIDRs to restrict ingress connections.
157+
*/
158+
ips: Array<ProxyEndpointsAPI.GatewayIPs>;
149159

150-
/**
151-
* Specify the list of CIDRs to restrict ingress connections.
152-
*/
153-
ips?: Array<GatewayIPs>;
160+
/**
161+
* Specify the name of the proxy endpoint.
162+
*/
163+
name: string;
154164

155-
/**
156-
* Specify the name of the proxy endpoint.
157-
*/
158-
name?: string;
165+
id?: string;
159166

160-
/**
161-
* Specify the subdomain to use as the destination in the proxy client.
162-
*/
163-
subdomain?: string;
167+
created_at?: string;
168+
169+
/**
170+
* The proxy endpoint kind
171+
*/
172+
kind?: 'ip';
173+
174+
/**
175+
* Specify the subdomain to use as the destination in the proxy client.
176+
*/
177+
subdomain?: string;
178+
179+
updated_at?: string;
180+
}
181+
182+
export interface ZeroTrustGatewayProxyEndpointIdentity {
183+
/**
184+
* The proxy endpoint kind
185+
*/
186+
kind: 'identity';
187+
188+
/**
189+
* Specify the name of the proxy endpoint.
190+
*/
191+
name: string;
192+
193+
id?: string;
194+
195+
created_at?: string;
196+
197+
/**
198+
* Specify the subdomain to use as the destination in the proxy client.
199+
*/
200+
subdomain?: string;
164201

165-
updated_at?: string;
202+
updated_at?: string;
203+
}
166204
}
167205

168206
export type ProxyEndpointDeleteResponse = unknown;
169207

170-
export interface ProxyEndpointCreateParams {
171-
/**
172-
* Path param:
173-
*/
174-
account_id: string;
208+
export type ProxyEndpointCreateParams =
209+
| ProxyEndpointCreateParams.ZeroTrustGatewayProxyEndpointIPCreate
210+
| ProxyEndpointCreateParams.ZeroTrustGatewayProxyEndpointIdentityCreate;
175211

176-
/**
177-
* Body param: Specify the list of CIDRs to restrict ingress connections.
178-
*/
179-
ips: Array<GatewayIPsParam>;
212+
export declare namespace ProxyEndpointCreateParams {
213+
export interface ZeroTrustGatewayProxyEndpointIPCreate {
214+
/**
215+
* Path param:
216+
*/
217+
account_id: string;
180218

181-
/**
182-
* Body param: Specify the name of the proxy endpoint.
183-
*/
184-
name: string;
219+
/**
220+
* Body param: Specify the name of the proxy endpoint.
221+
*/
222+
name: string;
223+
224+
/**
225+
* Body param: The proxy endpoint kind
226+
*/
227+
kind?: 'ip';
228+
}
229+
230+
export interface ZeroTrustGatewayProxyEndpointIdentityCreate {
231+
/**
232+
* Path param:
233+
*/
234+
account_id: string;
235+
236+
/**
237+
* Body param: The proxy endpoint kind
238+
*/
239+
kind: 'identity';
240+
241+
/**
242+
* Body param: Specify the name of the proxy endpoint.
243+
*/
244+
name: string;
245+
}
185246
}
186247

187248
export interface ProxyEndpointListParams {

tests/api-resources/zero-trust/gateway/proxy-endpoints.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ describe('resource proxyEndpoints', () => {
1313
test('create: only required params', async () => {
1414
const responsePromise = client.zeroTrust.gateway.proxyEndpoints.create({
1515
account_id: '699d98642c564d2e855e9661899b7252',
16-
ips: ['192.0.2.1/32'],
1716
name: 'Devops team',
1817
});
1918
const rawResponse = await responsePromise.asResponse();
@@ -28,8 +27,8 @@ describe('resource proxyEndpoints', () => {
2827
test('create: required and optional params', async () => {
2928
const response = await client.zeroTrust.gateway.proxyEndpoints.create({
3029
account_id: '699d98642c564d2e855e9661899b7252',
31-
ips: ['192.0.2.1/32'],
3230
name: 'Devops team',
31+
kind: 'ip',
3332
});
3433
});
3534

0 commit comments

Comments
 (0)