Skip to content

Commit edf2a7e

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#472)
1 parent f28f0d7 commit edf2a7e

File tree

7 files changed

+635
-3
lines changed

7 files changed

+635
-3
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 1269
1+
configured_endpoints: 1275
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-66b404214530cc73c44f34f297dad6bc8da0645b63e61d9d4fcbeb301e127e65.yml

api.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6426,4 +6426,28 @@ Methods:
64266426

64276427
# AIGateway
64286428

6429+
Types:
6430+
6431+
- <code><a href="./src/resources/ai-gateway/ai-gateway.ts">AIGatewayCreateResponse</a></code>
6432+
- <code><a href="./src/resources/ai-gateway/ai-gateway.ts">AIGatewayUpdateResponse</a></code>
6433+
- <code><a href="./src/resources/ai-gateway/ai-gateway.ts">AIGatewayListResponse</a></code>
6434+
- <code><a href="./src/resources/ai-gateway/ai-gateway.ts">AIGatewayDeleteResponse</a></code>
6435+
- <code><a href="./src/resources/ai-gateway/ai-gateway.ts">AIGatewayGetResponse</a></code>
6436+
6437+
Methods:
6438+
6439+
- <code title="post /accounts/{account_id}/ai-gateway/gateways">client.aiGateway.<a href="./src/resources/ai-gateway/ai-gateway.ts">create</a>({ ...params }) -> AIGatewayCreateResponse</code>
6440+
- <code title="put /accounts/{account_id}/ai-gateway/gateways/{id}">client.aiGateway.<a href="./src/resources/ai-gateway/ai-gateway.ts">update</a>(id, { ...params }) -> AIGatewayUpdateResponse</code>
6441+
- <code title="get /accounts/{account_id}/ai-gateway/gateways">client.aiGateway.<a href="./src/resources/ai-gateway/ai-gateway.ts">list</a>({ ...params }) -> AIGatewayListResponsesV4PagePaginationArray</code>
6442+
- <code title="delete /accounts/{account_id}/ai-gateway/gateways/{id}">client.aiGateway.<a href="./src/resources/ai-gateway/ai-gateway.ts">delete</a>(id, { ...params }) -> AIGatewayDeleteResponse</code>
6443+
- <code title="get /accounts/{account_id}/ai-gateway/gateways/{id}">client.aiGateway.<a href="./src/resources/ai-gateway/ai-gateway.ts">get</a>(id, { ...params }) -> AIGatewayGetResponse</code>
6444+
64296445
## Logs
6446+
6447+
Types:
6448+
6449+
- <code><a href="./src/resources/ai-gateway/logs.ts">LogGetResponse</a></code>
6450+
6451+
Methods:
6452+
6453+
- <code title="get /accounts/{account_id}/ai-gateway/gateways/{id}/logs">client.aiGateway.logs.<a href="./src/resources/ai-gateway/logs.ts">get</a>(id, { ...params }) -> LogGetResponse</code>
Lines changed: 331 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,343 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
import * as Core from 'cloudflare/core';
34
import { APIResource } from 'cloudflare/resource';
45
import * as LogsAPI from 'cloudflare/resources/ai-gateway/logs';
6+
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination';
57

68
export class AIGateway extends APIResource {
79
logs: LogsAPI.Logs = new LogsAPI.Logs(this._client);
10+
11+
/**
12+
* Create a new Gateway
13+
*/
14+
create(
15+
params: AIGatewayCreateParams,
16+
options?: Core.RequestOptions,
17+
): Core.APIPromise<AIGatewayCreateResponse> {
18+
const { account_id, ...body } = params;
19+
return (
20+
this._client.post(`/accounts/${account_id}/ai-gateway/gateways`, {
21+
body,
22+
...options,
23+
}) as Core.APIPromise<{ result: AIGatewayCreateResponse }>
24+
)._thenUnwrap((obj) => obj.result);
25+
}
26+
27+
/**
28+
* Update a Gateway
29+
*/
30+
update(
31+
id: string,
32+
params: AIGatewayUpdateParams,
33+
options?: Core.RequestOptions,
34+
): Core.APIPromise<AIGatewayUpdateResponse> {
35+
const { account_id, ...body } = params;
36+
return (
37+
this._client.put(`/accounts/${account_id}/ai-gateway/gateways/${id}`, {
38+
body,
39+
...options,
40+
}) as Core.APIPromise<{ result: AIGatewayUpdateResponse }>
41+
)._thenUnwrap((obj) => obj.result);
42+
}
43+
44+
/**
45+
* List Gateway's
46+
*/
47+
list(
48+
params: AIGatewayListParams,
49+
options?: Core.RequestOptions,
50+
): Core.PagePromise<AIGatewayListResponsesV4PagePaginationArray, AIGatewayListResponse> {
51+
const { account_id, ...query } = params;
52+
return this._client.getAPIList(
53+
`/accounts/${account_id}/ai-gateway/gateways`,
54+
AIGatewayListResponsesV4PagePaginationArray,
55+
{ query, ...options },
56+
);
57+
}
58+
59+
/**
60+
* Delete a Gateway
61+
*/
62+
delete(
63+
id: string,
64+
params: AIGatewayDeleteParams,
65+
options?: Core.RequestOptions,
66+
): Core.APIPromise<AIGatewayDeleteResponse> {
67+
const { account_id } = params;
68+
return (
69+
this._client.delete(`/accounts/${account_id}/ai-gateway/gateways/${id}`, options) as Core.APIPromise<{
70+
result: AIGatewayDeleteResponse;
71+
}>
72+
)._thenUnwrap((obj) => obj.result);
73+
}
74+
75+
/**
76+
* Fetch a Gateway
77+
*/
78+
get(
79+
id: string,
80+
params: AIGatewayGetParams,
81+
options?: Core.RequestOptions,
82+
): Core.APIPromise<AIGatewayGetResponse> {
83+
const { account_id } = params;
84+
return (
85+
this._client.get(`/accounts/${account_id}/ai-gateway/gateways/${id}`, options) as Core.APIPromise<{
86+
result: AIGatewayGetResponse;
87+
}>
88+
)._thenUnwrap((obj) => obj.result);
89+
}
90+
}
91+
92+
export class AIGatewayListResponsesV4PagePaginationArray extends V4PagePaginationArray<AIGatewayListResponse> {}
93+
94+
export interface AIGatewayCreateResponse {
95+
task: AIGatewayCreateResponse.Task;
96+
}
97+
98+
export namespace AIGatewayCreateResponse {
99+
export interface Task {
100+
id: string;
101+
102+
cache_invalidate_on_update: boolean;
103+
104+
cache_ttl: number;
105+
106+
collect_logs: boolean;
107+
108+
created_at: string;
109+
110+
modified_at: string;
111+
112+
name: string;
113+
114+
slug: string;
115+
116+
rate_limiting_interval?: number;
117+
118+
rate_limiting_limit?: number;
119+
120+
rate_limiting_technique?: string;
121+
}
122+
}
123+
124+
export interface AIGatewayUpdateResponse {
125+
id: string;
126+
127+
cache_invalidate_on_update: boolean;
128+
129+
cache_ttl: number;
130+
131+
collect_logs: boolean;
132+
133+
created_at: string;
134+
135+
modified_at: string;
136+
137+
name: string;
138+
139+
slug: string;
140+
141+
rate_limiting_interval?: number;
142+
143+
rate_limiting_limit?: number;
144+
145+
rate_limiting_technique?: string;
146+
}
147+
148+
export interface AIGatewayListResponse {
149+
id: string;
150+
151+
cache_invalidate_on_update: boolean;
152+
153+
cache_ttl: number;
154+
155+
collect_logs: boolean;
156+
157+
created_at: string;
158+
159+
modified_at: string;
160+
161+
name: string;
162+
163+
slug: string;
164+
165+
rate_limiting_interval?: number;
166+
167+
rate_limiting_limit?: number;
168+
169+
rate_limiting_technique?: string;
170+
}
171+
172+
export interface AIGatewayDeleteResponse {
173+
id: string;
174+
175+
cache_invalidate_on_update: boolean;
176+
177+
cache_ttl: number;
178+
179+
collect_logs: boolean;
180+
181+
created_at: string;
182+
183+
modified_at: string;
184+
185+
name: string;
186+
187+
slug: string;
188+
189+
rate_limiting_interval?: number;
190+
191+
rate_limiting_limit?: number;
192+
193+
rate_limiting_technique?: string;
194+
}
195+
196+
export interface AIGatewayGetResponse {
197+
id: string;
198+
199+
cache_invalidate_on_update: boolean;
200+
201+
cache_ttl: number;
202+
203+
collect_logs: boolean;
204+
205+
created_at: string;
206+
207+
modified_at: string;
208+
209+
name: string;
210+
211+
slug: string;
212+
213+
rate_limiting_interval?: number;
214+
215+
rate_limiting_limit?: number;
216+
217+
rate_limiting_technique?: string;
218+
}
219+
220+
export interface AIGatewayCreateParams {
221+
/**
222+
* Path param:
223+
*/
224+
account_id: string;
225+
226+
/**
227+
* Body param:
228+
*/
229+
cache_invalidate_on_update: boolean;
230+
231+
/**
232+
* Body param:
233+
*/
234+
cache_ttl: number;
235+
236+
/**
237+
* Body param:
238+
*/
239+
collect_logs: boolean;
240+
241+
/**
242+
* Body param:
243+
*/
244+
name: string;
245+
246+
/**
247+
* Body param:
248+
*/
249+
slug: string;
250+
251+
/**
252+
* Body param:
253+
*/
254+
rate_limiting_interval?: number;
255+
256+
/**
257+
* Body param:
258+
*/
259+
rate_limiting_limit?: number;
260+
261+
/**
262+
* Body param:
263+
*/
264+
rate_limiting_technique?: string;
265+
}
266+
267+
export interface AIGatewayUpdateParams {
268+
/**
269+
* Path param:
270+
*/
271+
account_id: string;
272+
273+
/**
274+
* Body param:
275+
*/
276+
cache_invalidate_on_update: boolean;
277+
278+
/**
279+
* Body param:
280+
*/
281+
cache_ttl: number;
282+
283+
/**
284+
* Body param:
285+
*/
286+
collect_logs: boolean;
287+
288+
/**
289+
* Body param:
290+
*/
291+
name: string;
292+
293+
/**
294+
* Body param:
295+
*/
296+
slug: string;
297+
298+
/**
299+
* Body param:
300+
*/
301+
rate_limiting_interval?: number;
302+
303+
/**
304+
* Body param:
305+
*/
306+
rate_limiting_limit?: number;
307+
308+
/**
309+
* Body param:
310+
*/
311+
rate_limiting_technique?: string;
312+
}
313+
314+
export interface AIGatewayListParams extends V4PagePaginationArrayParams {
315+
/**
316+
* Path param:
317+
*/
318+
account_id: string;
319+
320+
/**
321+
* Query param:
322+
*/
323+
id?: string;
324+
325+
/**
326+
* Query param: Order By Column Name
327+
*/
328+
order_by?: string;
329+
}
330+
331+
export interface AIGatewayDeleteParams {
332+
account_id: string;
333+
}
334+
335+
export interface AIGatewayGetParams {
336+
account_id: string;
8337
}
9338

10339
export namespace AIGateway {
11340
export import Logs = LogsAPI.Logs;
341+
export import LogGetResponse = LogsAPI.LogGetResponse;
342+
export import LogGetParams = LogsAPI.LogGetParams;
12343
}

src/resources/ai-gateway/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
export { AIGateway } from './ai-gateway';
4-
export { Logs } from './logs';
4+
export { LogGetResponse, LogGetParams, Logs } from './logs';

0 commit comments

Comments
 (0)