Skip to content

Commit fac8095

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

File tree

14 files changed

+89
-138
lines changed

14 files changed

+89
-138
lines changed

api.md

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

22692269
Types:
22702270

2271-
- <code><a href="./src/resources/workers/ai/ai.ts">AIRunResponse</a></code>
2271+
- <code><a href="./src/resources/workers/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/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>
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>
23042276

23052277
## Scripts
23062278

@@ -6451,3 +6423,31 @@ Methods:
64516423

64526424
- <code title="put /accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}">client.eventNotifications.r2.configuration.queues.<a href="./src/resources/event-notifications/r2/configuration/queues.ts">update</a>(bucketName, queueId, { ...params }) -> QueueUpdateResponse</code>
64536425
- <code title="delete /accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}">client.eventNotifications.r2.configuration.queues.<a href="./src/resources/event-notifications/r2/configuration/queues.ts">delete</a>(bucketName, queueId, { ...params }) -> QueueDeleteResponse</code>
6426+
6427+
# AIGateway
6428+
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_tag}/ai-gateway/gateways">client.aiGateway.<a href="./src/resources/ai-gateway/ai-gateway.ts">create</a>(accountTag, { ...params }) -> AIGatewayCreateResponse</code>
6440+
- <code title="put /accounts/{account_tag}/ai-gateway/gateways/{id}">client.aiGateway.<a href="./src/resources/ai-gateway/ai-gateway.ts">update</a>(accountTag, id, { ...params }) -> AIGatewayUpdateResponse</code>
6441+
- <code title="get /accounts/{account_tag}/ai-gateway/gateways">client.aiGateway.<a href="./src/resources/ai-gateway/ai-gateway.ts">list</a>(accountTag, { ...params }) -> AIGatewayListResponsesV4PagePaginationArray</code>
6442+
- <code title="delete /accounts/{account_tag}/ai-gateway/gateways/{id}">client.aiGateway.<a href="./src/resources/ai-gateway/ai-gateway.ts">delete</a>(accountTag, id) -> AIGatewayDeleteResponse</code>
6443+
- <code title="get /accounts/{account_tag}/ai-gateway/gateways/{id}">client.aiGateway.<a href="./src/resources/ai-gateway/ai-gateway.ts">get</a>(accountTag, id) -> AIGatewayGetResponse</code>
6444+
6445+
## 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_tag}/ai-gateway/gateways/{id}/logs">client.aiGateway.logs.<a href="./src/resources/ai-gateway/logs.ts">get</a>(accountTag, id, { ...params }) -> LogGetResponse</code>

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ export class Cloudflare extends Core.APIClient {
223223
calls: API.Calls = new API.Calls(this);
224224
cloudforceOne: API.CloudforceOne = new API.CloudforceOne(this);
225225
eventNotifications: API.EventNotifications = new API.EventNotifications(this);
226+
aiGateway: API.AIGateway = new API.AIGateway(this);
226227

227228
protected override defaultQuery(): Core.DefaultQuery | undefined {
228229
return this._options.defaultQuery;
@@ -551,6 +552,8 @@ export namespace Cloudflare {
551552

552553
export import EventNotifications = API.EventNotifications;
553554

555+
export import AIGateway = API.AIGateway;
556+
554557
export import ASN = API.ASN;
555558
export import AuditLog = API.AuditLog;
556559
export import CloudflareTunnel = API.CloudflareTunnel;

src/resources/workers/ai/gateways/gateways.ts renamed to src/resources/ai-gateway/ai-gateway.ts

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,25 @@
33
import * as Core from 'cloudflare/core';
44
import { APIResource } from 'cloudflare/resource';
55
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';
6+
import * as LogsAPI from 'cloudflare/resources/ai-gateway/logs';
87
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination';
98

10-
export class Gateways extends APIResource {
9+
export class AIGateway extends APIResource {
1110
logs: LogsAPI.Logs = new LogsAPI.Logs(this._client);
1211

1312
/**
1413
* Create a new Gateway
1514
*/
1615
create(
1716
accountTag: string,
18-
body: GatewayCreateParams,
17+
body: AIGatewayCreateParams,
1918
options?: Core.RequestOptions,
20-
): Core.APIPromise<GatewayCreateResponse> {
19+
): Core.APIPromise<AIGatewayCreateResponse> {
2120
return (
2221
this._client.post(`/accounts/${accountTag}/ai-gateway/gateways`, {
2322
body,
2423
...options,
25-
}) as Core.APIPromise<{ result: GatewayCreateResponse }>
24+
}) as Core.APIPromise<{ result: AIGatewayCreateResponse }>
2625
)._thenUnwrap((obj) => obj.result);
2726
}
2827

@@ -32,14 +31,14 @@ export class Gateways extends APIResource {
3231
update(
3332
accountTag: string,
3433
id: string,
35-
body: GatewayUpdateParams,
34+
body: AIGatewayUpdateParams,
3635
options?: Core.RequestOptions,
37-
): Core.APIPromise<GatewayUpdateResponse> {
36+
): Core.APIPromise<AIGatewayUpdateResponse> {
3837
return (
3938
this._client.put(`/accounts/${accountTag}/ai-gateway/gateways/${id}`, {
4039
body,
4140
...options,
42-
}) as Core.APIPromise<{ result: GatewayUpdateResponse }>
41+
}) as Core.APIPromise<{ result: AIGatewayUpdateResponse }>
4342
)._thenUnwrap((obj) => obj.result);
4443
}
4544

@@ -48,24 +47,24 @@ export class Gateways extends APIResource {
4847
*/
4948
list(
5049
accountTag: string,
51-
query?: GatewayListParams,
50+
query?: AIGatewayListParams,
5251
options?: Core.RequestOptions,
53-
): Core.PagePromise<GatewayListResponsesV4PagePaginationArray, GatewayListResponse>;
52+
): Core.PagePromise<AIGatewayListResponsesV4PagePaginationArray, AIGatewayListResponse>;
5453
list(
5554
accountTag: string,
5655
options?: Core.RequestOptions,
57-
): Core.PagePromise<GatewayListResponsesV4PagePaginationArray, GatewayListResponse>;
56+
): Core.PagePromise<AIGatewayListResponsesV4PagePaginationArray, AIGatewayListResponse>;
5857
list(
5958
accountTag: string,
60-
query: GatewayListParams | Core.RequestOptions = {},
59+
query: AIGatewayListParams | Core.RequestOptions = {},
6160
options?: Core.RequestOptions,
62-
): Core.PagePromise<GatewayListResponsesV4PagePaginationArray, GatewayListResponse> {
61+
): Core.PagePromise<AIGatewayListResponsesV4PagePaginationArray, AIGatewayListResponse> {
6362
if (isRequestOptions(query)) {
6463
return this.list(accountTag, {}, query);
6564
}
6665
return this._client.getAPIList(
6766
`/accounts/${accountTag}/ai-gateway/gateways`,
68-
GatewayListResponsesV4PagePaginationArray,
67+
AIGatewayListResponsesV4PagePaginationArray,
6968
{ query, ...options },
7069
);
7170
}
@@ -77,33 +76,33 @@ export class Gateways extends APIResource {
7776
accountTag: string,
7877
id: string,
7978
options?: Core.RequestOptions,
80-
): Core.APIPromise<GatewayDeleteResponse> {
79+
): Core.APIPromise<AIGatewayDeleteResponse> {
8180
return (
8281
this._client.delete(`/accounts/${accountTag}/ai-gateway/gateways/${id}`, options) as Core.APIPromise<{
83-
result: GatewayDeleteResponse;
82+
result: AIGatewayDeleteResponse;
8483
}>
8584
)._thenUnwrap((obj) => obj.result);
8685
}
8786

8887
/**
8988
* Fetch a Gateway
9089
*/
91-
get(accountTag: string, id: string, options?: Core.RequestOptions): Core.APIPromise<GatewayGetResponse> {
90+
get(accountTag: string, id: string, options?: Core.RequestOptions): Core.APIPromise<AIGatewayGetResponse> {
9291
return (
9392
this._client.get(`/accounts/${accountTag}/ai-gateway/gateways/${id}`, options) as Core.APIPromise<{
94-
result: GatewayGetResponse;
93+
result: AIGatewayGetResponse;
9594
}>
9695
)._thenUnwrap((obj) => obj.result);
9796
}
9897
}
9998

100-
export class GatewayListResponsesV4PagePaginationArray extends V4PagePaginationArray<GatewayListResponse> {}
99+
export class AIGatewayListResponsesV4PagePaginationArray extends V4PagePaginationArray<AIGatewayListResponse> {}
101100

102-
export interface GatewayCreateResponse {
103-
task: GatewayCreateResponse.Task;
101+
export interface AIGatewayCreateResponse {
102+
task: AIGatewayCreateResponse.Task;
104103
}
105104

106-
export namespace GatewayCreateResponse {
105+
export namespace AIGatewayCreateResponse {
107106
export interface Task {
108107
id: string;
109108

@@ -129,7 +128,7 @@ export namespace GatewayCreateResponse {
129128
}
130129
}
131130

132-
export interface GatewayUpdateResponse {
131+
export interface AIGatewayUpdateResponse {
133132
id: string;
134133

135134
cache_invalidate_on_update: boolean;
@@ -153,7 +152,7 @@ export interface GatewayUpdateResponse {
153152
rate_limiting_technique?: string;
154153
}
155154

156-
export interface GatewayListResponse {
155+
export interface AIGatewayListResponse {
157156
id: string;
158157

159158
cache_invalidate_on_update: boolean;
@@ -177,7 +176,7 @@ export interface GatewayListResponse {
177176
rate_limiting_technique?: string;
178177
}
179178

180-
export interface GatewayDeleteResponse {
179+
export interface AIGatewayDeleteResponse {
181180
id: string;
182181

183182
cache_invalidate_on_update: boolean;
@@ -201,7 +200,7 @@ export interface GatewayDeleteResponse {
201200
rate_limiting_technique?: string;
202201
}
203202

204-
export interface GatewayGetResponse {
203+
export interface AIGatewayGetResponse {
205204
id: string;
206205

207206
cache_invalidate_on_update: boolean;
@@ -225,7 +224,7 @@ export interface GatewayGetResponse {
225224
rate_limiting_technique?: string;
226225
}
227226

228-
export interface GatewayCreateParams {
227+
export interface AIGatewayCreateParams {
229228
cache_invalidate_on_update: boolean;
230229

231230
cache_ttl: number;
@@ -243,7 +242,7 @@ export interface GatewayCreateParams {
243242
rate_limiting_technique?: string;
244243
}
245244

246-
export interface GatewayUpdateParams {
245+
export interface AIGatewayUpdateParams {
247246
cache_invalidate_on_update: boolean;
248247

249248
cache_ttl: number;
@@ -261,7 +260,7 @@ export interface GatewayUpdateParams {
261260
rate_limiting_technique?: string;
262261
}
263262

264-
export interface GatewayListParams extends V4PagePaginationArrayParams {
263+
export interface AIGatewayListParams extends V4PagePaginationArrayParams {
265264
id?: string;
266265

267266
/**
@@ -270,16 +269,7 @@ export interface GatewayListParams extends V4PagePaginationArrayParams {
270269
order_by?: string;
271270
}
272271

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;
272+
export namespace AIGateway {
283273
export import Logs = LogsAPI.Logs;
284274
export import LogGetResponse = LogsAPI.LogGetResponse;
285275
export import LogGetParams = LogsAPI.LogGetParams;

src/resources/ai-gateway/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export { AIGateway } from './ai-gateway';
4+
export { LogGetResponse, LogGetParams, Logs } from './logs';

src/resources/workers/ai/gateways/logs.ts renamed to src/resources/ai-gateway/logs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import * as Core from 'cloudflare/core';
44
import { APIResource } from 'cloudflare/resource';
55
import { isRequestOptions } from 'cloudflare/core';
6-
import * as LogsAPI from 'cloudflare/resources/workers/ai/gateways/logs';
6+
import * as LogsAPI from 'cloudflare/resources/ai-gateway/logs';
77

88
export class Logs extends APIResource {
99
/**

src/resources/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
export * from './shared';
44
export { ACM } from './acm/acm';
5+
export { AIGateway } from './ai-gateway/ai-gateway';
56
export { Accounts } from './accounts/accounts';
67
export { Addressing } from './addressing/addressing';
78
export { Alerting } from './alerting/alerting';

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

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

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

98
export class AI extends APIResource {
10-
gateways: GatewaysAPI.Gateways = new GatewaysAPI.Gateways(this._client);
11-
129
/**
1310
* This endpoint provides users with the capability to run specific AI models
1411
* on-demand.
@@ -382,14 +379,4 @@ export namespace AIRunParams {
382379
export namespace AI {
383380
export import AIRunResponse = AIAPI.AIRunResponse;
384381
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;
395382
}

src/resources/workers/ai/gateways/index.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/resources/workers/ai/index.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/resources/workers/index.ts

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

3-
export { AIRunResponse, AIRunParams, AI } from './ai/index';
3+
export { AIRunResponse, AIRunParams, AI } from './ai';
44
export {
55
AccountSettingUpdateResponse,
66
AccountSettingGetResponse,

0 commit comments

Comments
 (0)