Skip to content

Commit 71b3707

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#468)
1 parent 35375e6 commit 71b3707

File tree

12 files changed

+667
-6
lines changed

12 files changed

+667
-6
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-ecba01cd225d19e1decd3caa323399e3f580a2abbdd4a756fa536063651facee.yml

api.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,11 +2268,39 @@ Types:
22682268

22692269
Types:
22702270

2271-
- <code><a href="./src/resources/workers/ai.ts">AIRunResponse</a></code>
2271+
- <code><a href="./src/resources/workers/ai/ai.ts">AIRunResponse</a></code>
22722272

22732273
Methods:
22742274

2275-
- <code title="post /accounts/{account_id}/ai/run/{model_name}">client.workers.ai.<a href="./src/resources/workers/ai.ts">run</a>(modelName, { ...params }) -> AIRunResponse</code>
2275+
- <code title="post /accounts/{account_id}/ai/run/{model_name}">client.workers.ai.<a href="./src/resources/workers/ai/ai.ts">run</a>(modelName, { ...params }) -> AIRunResponse</code>
2276+
2277+
### Gateways
2278+
2279+
Types:
2280+
2281+
- <code><a href="./src/resources/workers/ai/gateways/gateways.ts">GatewayCreateResponse</a></code>
2282+
- <code><a href="./src/resources/workers/ai/gateways/gateways.ts">GatewayUpdateResponse</a></code>
2283+
- <code><a href="./src/resources/workers/ai/gateways/gateways.ts">GatewayListResponse</a></code>
2284+
- <code><a href="./src/resources/workers/ai/gateways/gateways.ts">GatewayDeleteResponse</a></code>
2285+
- <code><a href="./src/resources/workers/ai/gateways/gateways.ts">GatewayGetResponse</a></code>
2286+
2287+
Methods:
2288+
2289+
- <code title="post /accounts/{account_tag}/ai-gateway/gateways">client.workers.ai.gateways.<a href="./src/resources/workers/ai/gateways/gateways.ts">create</a>(accountTag, { ...params }) -> GatewayCreateResponse</code>
2290+
- <code title="put /accounts/{account_tag}/ai-gateway/gateways/{id}">client.workers.ai.gateways.<a href="./src/resources/workers/ai/gateways/gateways.ts">update</a>(accountTag, id, { ...params }) -> GatewayUpdateResponse</code>
2291+
- <code title="get /accounts/{account_tag}/ai-gateway/gateways">client.workers.ai.gateways.<a href="./src/resources/workers/ai/gateways/gateways.ts">list</a>(accountTag, { ...params }) -> GatewayListResponsesV4PagePaginationArray</code>
2292+
- <code title="delete /accounts/{account_tag}/ai-gateway/gateways/{id}">client.workers.ai.gateways.<a href="./src/resources/workers/ai/gateways/gateways.ts">delete</a>(accountTag, id) -> GatewayDeleteResponse</code>
2293+
- <code title="get /accounts/{account_tag}/ai-gateway/gateways/{id}">client.workers.ai.gateways.<a href="./src/resources/workers/ai/gateways/gateways.ts">get</a>(accountTag, id) -> GatewayGetResponse</code>
2294+
2295+
#### Logs
2296+
2297+
Types:
2298+
2299+
- <code><a href="./src/resources/workers/ai/gateways/logs.ts">LogGetResponse</a></code>
2300+
2301+
Methods:
2302+
2303+
- <code title="get /accounts/{account_tag}/ai-gateway/gateways/{id}/logs">client.workers.ai.gateways.logs.<a href="./src/resources/workers/ai/gateways/logs.ts">get</a>(accountTag, id, { ...params }) -> LogGetResponse</code>
22762304

22772305
## Scripts
22782306

src/resources/workers/ai.ts renamed to src/resources/workers/ai/ai.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
import * as Core from 'cloudflare/core';
44
import { APIResource } from 'cloudflare/resource';
5-
import * as AIAPI from 'cloudflare/resources/workers/ai';
5+
import * as AIAPI from 'cloudflare/resources/workers/ai/ai';
6+
import * as GatewaysAPI from 'cloudflare/resources/workers/ai/gateways/gateways';
67
import { type Uploadable } from 'cloudflare/core';
78

89
export class AI extends APIResource {
10+
gateways: GatewaysAPI.Gateways = new GatewaysAPI.Gateways(this._client);
11+
912
/**
1013
* This endpoint provides users with the capability to run specific AI models
1114
* on-demand.
@@ -379,4 +382,14 @@ export namespace AIRunParams {
379382
export namespace AI {
380383
export import AIRunResponse = AIAPI.AIRunResponse;
381384
export import AIRunParams = AIAPI.AIRunParams;
385+
export import Gateways = GatewaysAPI.Gateways;
386+
export import GatewayCreateResponse = GatewaysAPI.GatewayCreateResponse;
387+
export import GatewayUpdateResponse = GatewaysAPI.GatewayUpdateResponse;
388+
export import GatewayListResponse = GatewaysAPI.GatewayListResponse;
389+
export import GatewayDeleteResponse = GatewaysAPI.GatewayDeleteResponse;
390+
export import GatewayGetResponse = GatewaysAPI.GatewayGetResponse;
391+
export import GatewayListResponsesV4PagePaginationArray = GatewaysAPI.GatewayListResponsesV4PagePaginationArray;
392+
export import GatewayCreateParams = GatewaysAPI.GatewayCreateParams;
393+
export import GatewayUpdateParams = GatewaysAPI.GatewayUpdateParams;
394+
export import GatewayListParams = GatewaysAPI.GatewayListParams;
382395
}
Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import * as Core from 'cloudflare/core';
4+
import { APIResource } from 'cloudflare/resource';
5+
import { isRequestOptions } from 'cloudflare/core';
6+
import * as GatewaysAPI from 'cloudflare/resources/workers/ai/gateways/gateways';
7+
import * as LogsAPI from 'cloudflare/resources/workers/ai/gateways/logs';
8+
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination';
9+
10+
export class Gateways extends APIResource {
11+
logs: LogsAPI.Logs = new LogsAPI.Logs(this._client);
12+
13+
/**
14+
* Create a new Gateway
15+
*/
16+
create(
17+
accountTag: string,
18+
body: GatewayCreateParams,
19+
options?: Core.RequestOptions,
20+
): Core.APIPromise<GatewayCreateResponse> {
21+
return (
22+
this._client.post(`/accounts/${accountTag}/ai-gateway/gateways`, {
23+
body,
24+
...options,
25+
}) as Core.APIPromise<{ result: GatewayCreateResponse }>
26+
)._thenUnwrap((obj) => obj.result);
27+
}
28+
29+
/**
30+
* Update a Gateway
31+
*/
32+
update(
33+
accountTag: string,
34+
id: string,
35+
body: GatewayUpdateParams,
36+
options?: Core.RequestOptions,
37+
): Core.APIPromise<GatewayUpdateResponse> {
38+
return (
39+
this._client.put(`/accounts/${accountTag}/ai-gateway/gateways/${id}`, {
40+
body,
41+
...options,
42+
}) as Core.APIPromise<{ result: GatewayUpdateResponse }>
43+
)._thenUnwrap((obj) => obj.result);
44+
}
45+
46+
/**
47+
* List Gateway's
48+
*/
49+
list(
50+
accountTag: string,
51+
query?: GatewayListParams,
52+
options?: Core.RequestOptions,
53+
): Core.PagePromise<GatewayListResponsesV4PagePaginationArray, GatewayListResponse>;
54+
list(
55+
accountTag: string,
56+
options?: Core.RequestOptions,
57+
): Core.PagePromise<GatewayListResponsesV4PagePaginationArray, GatewayListResponse>;
58+
list(
59+
accountTag: string,
60+
query: GatewayListParams | Core.RequestOptions = {},
61+
options?: Core.RequestOptions,
62+
): Core.PagePromise<GatewayListResponsesV4PagePaginationArray, GatewayListResponse> {
63+
if (isRequestOptions(query)) {
64+
return this.list(accountTag, {}, query);
65+
}
66+
return this._client.getAPIList(
67+
`/accounts/${accountTag}/ai-gateway/gateways`,
68+
GatewayListResponsesV4PagePaginationArray,
69+
{ query, ...options },
70+
);
71+
}
72+
73+
/**
74+
* Delete a Gateway
75+
*/
76+
delete(
77+
accountTag: string,
78+
id: string,
79+
options?: Core.RequestOptions,
80+
): Core.APIPromise<GatewayDeleteResponse> {
81+
return (
82+
this._client.delete(`/accounts/${accountTag}/ai-gateway/gateways/${id}`, options) as Core.APIPromise<{
83+
result: GatewayDeleteResponse;
84+
}>
85+
)._thenUnwrap((obj) => obj.result);
86+
}
87+
88+
/**
89+
* Fetch a Gateway
90+
*/
91+
get(accountTag: string, id: string, options?: Core.RequestOptions): Core.APIPromise<GatewayGetResponse> {
92+
return (
93+
this._client.get(`/accounts/${accountTag}/ai-gateway/gateways/${id}`, options) as Core.APIPromise<{
94+
result: GatewayGetResponse;
95+
}>
96+
)._thenUnwrap((obj) => obj.result);
97+
}
98+
}
99+
100+
export class GatewayListResponsesV4PagePaginationArray extends V4PagePaginationArray<GatewayListResponse> {}
101+
102+
export interface GatewayCreateResponse {
103+
task: GatewayCreateResponse.Task;
104+
}
105+
106+
export namespace GatewayCreateResponse {
107+
export interface Task {
108+
id: string;
109+
110+
cache_invalidate_on_update: boolean;
111+
112+
cache_ttl: number;
113+
114+
collect_logs: boolean;
115+
116+
created_at: string;
117+
118+
modified_at: string;
119+
120+
name: string;
121+
122+
slug: string;
123+
124+
rate_limiting_interval?: number;
125+
126+
rate_limiting_limit?: number;
127+
128+
rate_limiting_technique?: string;
129+
}
130+
}
131+
132+
export interface GatewayUpdateResponse {
133+
id: string;
134+
135+
cache_invalidate_on_update: boolean;
136+
137+
cache_ttl: number;
138+
139+
collect_logs: boolean;
140+
141+
created_at: string;
142+
143+
modified_at: string;
144+
145+
name: string;
146+
147+
slug: string;
148+
149+
rate_limiting_interval?: number;
150+
151+
rate_limiting_limit?: number;
152+
153+
rate_limiting_technique?: string;
154+
}
155+
156+
export interface GatewayListResponse {
157+
id: string;
158+
159+
cache_invalidate_on_update: boolean;
160+
161+
cache_ttl: number;
162+
163+
collect_logs: boolean;
164+
165+
created_at: string;
166+
167+
modified_at: string;
168+
169+
name: string;
170+
171+
slug: string;
172+
173+
rate_limiting_interval?: number;
174+
175+
rate_limiting_limit?: number;
176+
177+
rate_limiting_technique?: string;
178+
}
179+
180+
export interface GatewayDeleteResponse {
181+
id: string;
182+
183+
cache_invalidate_on_update: boolean;
184+
185+
cache_ttl: number;
186+
187+
collect_logs: boolean;
188+
189+
created_at: string;
190+
191+
modified_at: string;
192+
193+
name: string;
194+
195+
slug: string;
196+
197+
rate_limiting_interval?: number;
198+
199+
rate_limiting_limit?: number;
200+
201+
rate_limiting_technique?: string;
202+
}
203+
204+
export interface GatewayGetResponse {
205+
id: string;
206+
207+
cache_invalidate_on_update: boolean;
208+
209+
cache_ttl: number;
210+
211+
collect_logs: boolean;
212+
213+
created_at: string;
214+
215+
modified_at: string;
216+
217+
name: string;
218+
219+
slug: string;
220+
221+
rate_limiting_interval?: number;
222+
223+
rate_limiting_limit?: number;
224+
225+
rate_limiting_technique?: string;
226+
}
227+
228+
export interface GatewayCreateParams {
229+
cache_invalidate_on_update: boolean;
230+
231+
cache_ttl: number;
232+
233+
collect_logs: boolean;
234+
235+
name: string;
236+
237+
slug: string;
238+
239+
rate_limiting_interval?: number;
240+
241+
rate_limiting_limit?: number;
242+
243+
rate_limiting_technique?: string;
244+
}
245+
246+
export interface GatewayUpdateParams {
247+
cache_invalidate_on_update: boolean;
248+
249+
cache_ttl: number;
250+
251+
collect_logs: boolean;
252+
253+
name: string;
254+
255+
slug: string;
256+
257+
rate_limiting_interval?: number;
258+
259+
rate_limiting_limit?: number;
260+
261+
rate_limiting_technique?: string;
262+
}
263+
264+
export interface GatewayListParams extends V4PagePaginationArrayParams {
265+
id?: string;
266+
267+
/**
268+
* Order By Column Name
269+
*/
270+
order_by?: string;
271+
}
272+
273+
export namespace Gateways {
274+
export import GatewayCreateResponse = GatewaysAPI.GatewayCreateResponse;
275+
export import GatewayUpdateResponse = GatewaysAPI.GatewayUpdateResponse;
276+
export import GatewayListResponse = GatewaysAPI.GatewayListResponse;
277+
export import GatewayDeleteResponse = GatewaysAPI.GatewayDeleteResponse;
278+
export import GatewayGetResponse = GatewaysAPI.GatewayGetResponse;
279+
export import GatewayListResponsesV4PagePaginationArray = GatewaysAPI.GatewayListResponsesV4PagePaginationArray;
280+
export import GatewayCreateParams = GatewaysAPI.GatewayCreateParams;
281+
export import GatewayUpdateParams = GatewaysAPI.GatewayUpdateParams;
282+
export import GatewayListParams = GatewaysAPI.GatewayListParams;
283+
export import Logs = LogsAPI.Logs;
284+
export import LogGetResponse = LogsAPI.LogGetResponse;
285+
export import LogGetParams = LogsAPI.LogGetParams;
286+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export {
4+
GatewayCreateResponse,
5+
GatewayUpdateResponse,
6+
GatewayListResponse,
7+
GatewayDeleteResponse,
8+
GatewayGetResponse,
9+
GatewayCreateParams,
10+
GatewayUpdateParams,
11+
GatewayListParams,
12+
GatewayListResponsesV4PagePaginationArray,
13+
Gateways,
14+
} from './gateways';
15+
export { LogGetResponse, LogGetParams, Logs } from './logs';

0 commit comments

Comments
 (0)