3
3
import * as Core from 'cloudflare/core' ;
4
4
import { APIResource } from 'cloudflare/resource' ;
5
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' ;
6
+ import * as LogsAPI from 'cloudflare/resources/ai-gateway/logs' ;
8
7
import { V4PagePaginationArray , type V4PagePaginationArrayParams } from 'cloudflare/pagination' ;
9
8
10
- export class Gateways extends APIResource {
9
+ export class AIGateway extends APIResource {
11
10
logs : LogsAPI . Logs = new LogsAPI . Logs ( this . _client ) ;
12
11
13
12
/**
14
13
* Create a new Gateway
15
14
*/
16
15
create (
17
16
accountTag : string ,
18
- body : GatewayCreateParams ,
17
+ body : AIGatewayCreateParams ,
19
18
options ?: Core . RequestOptions ,
20
- ) : Core . APIPromise < GatewayCreateResponse > {
19
+ ) : Core . APIPromise < AIGatewayCreateResponse > {
21
20
return (
22
21
this . _client . post ( `/accounts/${ accountTag } /ai-gateway/gateways` , {
23
22
body,
24
23
...options ,
25
- } ) as Core . APIPromise < { result : GatewayCreateResponse } >
24
+ } ) as Core . APIPromise < { result : AIGatewayCreateResponse } >
26
25
) . _thenUnwrap ( ( obj ) => obj . result ) ;
27
26
}
28
27
@@ -32,14 +31,14 @@ export class Gateways extends APIResource {
32
31
update (
33
32
accountTag : string ,
34
33
id : string ,
35
- body : GatewayUpdateParams ,
34
+ body : AIGatewayUpdateParams ,
36
35
options ?: Core . RequestOptions ,
37
- ) : Core . APIPromise < GatewayUpdateResponse > {
36
+ ) : Core . APIPromise < AIGatewayUpdateResponse > {
38
37
return (
39
38
this . _client . put ( `/accounts/${ accountTag } /ai-gateway/gateways/${ id } ` , {
40
39
body,
41
40
...options ,
42
- } ) as Core . APIPromise < { result : GatewayUpdateResponse } >
41
+ } ) as Core . APIPromise < { result : AIGatewayUpdateResponse } >
43
42
) . _thenUnwrap ( ( obj ) => obj . result ) ;
44
43
}
45
44
@@ -48,24 +47,24 @@ export class Gateways extends APIResource {
48
47
*/
49
48
list (
50
49
accountTag : string ,
51
- query ?: GatewayListParams ,
50
+ query ?: AIGatewayListParams ,
52
51
options ?: Core . RequestOptions ,
53
- ) : Core . PagePromise < GatewayListResponsesV4PagePaginationArray , GatewayListResponse > ;
52
+ ) : Core . PagePromise < AIGatewayListResponsesV4PagePaginationArray , AIGatewayListResponse > ;
54
53
list (
55
54
accountTag : string ,
56
55
options ?: Core . RequestOptions ,
57
- ) : Core . PagePromise < GatewayListResponsesV4PagePaginationArray , GatewayListResponse > ;
56
+ ) : Core . PagePromise < AIGatewayListResponsesV4PagePaginationArray , AIGatewayListResponse > ;
58
57
list (
59
58
accountTag : string ,
60
- query : GatewayListParams | Core . RequestOptions = { } ,
59
+ query : AIGatewayListParams | Core . RequestOptions = { } ,
61
60
options ?: Core . RequestOptions ,
62
- ) : Core . PagePromise < GatewayListResponsesV4PagePaginationArray , GatewayListResponse > {
61
+ ) : Core . PagePromise < AIGatewayListResponsesV4PagePaginationArray , AIGatewayListResponse > {
63
62
if ( isRequestOptions ( query ) ) {
64
63
return this . list ( accountTag , { } , query ) ;
65
64
}
66
65
return this . _client . getAPIList (
67
66
`/accounts/${ accountTag } /ai-gateway/gateways` ,
68
- GatewayListResponsesV4PagePaginationArray ,
67
+ AIGatewayListResponsesV4PagePaginationArray ,
69
68
{ query, ...options } ,
70
69
) ;
71
70
}
@@ -77,33 +76,33 @@ export class Gateways extends APIResource {
77
76
accountTag : string ,
78
77
id : string ,
79
78
options ?: Core . RequestOptions ,
80
- ) : Core . APIPromise < GatewayDeleteResponse > {
79
+ ) : Core . APIPromise < AIGatewayDeleteResponse > {
81
80
return (
82
81
this . _client . delete ( `/accounts/${ accountTag } /ai-gateway/gateways/${ id } ` , options ) as Core . APIPromise < {
83
- result : GatewayDeleteResponse ;
82
+ result : AIGatewayDeleteResponse ;
84
83
} >
85
84
) . _thenUnwrap ( ( obj ) => obj . result ) ;
86
85
}
87
86
88
87
/**
89
88
* Fetch a Gateway
90
89
*/
91
- get ( accountTag : string , id : string , options ?: Core . RequestOptions ) : Core . APIPromise < GatewayGetResponse > {
90
+ get ( accountTag : string , id : string , options ?: Core . RequestOptions ) : Core . APIPromise < AIGatewayGetResponse > {
92
91
return (
93
92
this . _client . get ( `/accounts/${ accountTag } /ai-gateway/gateways/${ id } ` , options ) as Core . APIPromise < {
94
- result : GatewayGetResponse ;
93
+ result : AIGatewayGetResponse ;
95
94
} >
96
95
) . _thenUnwrap ( ( obj ) => obj . result ) ;
97
96
}
98
97
}
99
98
100
- export class GatewayListResponsesV4PagePaginationArray extends V4PagePaginationArray < GatewayListResponse > { }
99
+ export class AIGatewayListResponsesV4PagePaginationArray extends V4PagePaginationArray < AIGatewayListResponse > { }
101
100
102
- export interface GatewayCreateResponse {
103
- task : GatewayCreateResponse . Task ;
101
+ export interface AIGatewayCreateResponse {
102
+ task : AIGatewayCreateResponse . Task ;
104
103
}
105
104
106
- export namespace GatewayCreateResponse {
105
+ export namespace AIGatewayCreateResponse {
107
106
export interface Task {
108
107
id : string ;
109
108
@@ -129,7 +128,7 @@ export namespace GatewayCreateResponse {
129
128
}
130
129
}
131
130
132
- export interface GatewayUpdateResponse {
131
+ export interface AIGatewayUpdateResponse {
133
132
id : string ;
134
133
135
134
cache_invalidate_on_update : boolean ;
@@ -153,7 +152,7 @@ export interface GatewayUpdateResponse {
153
152
rate_limiting_technique ?: string ;
154
153
}
155
154
156
- export interface GatewayListResponse {
155
+ export interface AIGatewayListResponse {
157
156
id : string ;
158
157
159
158
cache_invalidate_on_update : boolean ;
@@ -177,7 +176,7 @@ export interface GatewayListResponse {
177
176
rate_limiting_technique ?: string ;
178
177
}
179
178
180
- export interface GatewayDeleteResponse {
179
+ export interface AIGatewayDeleteResponse {
181
180
id : string ;
182
181
183
182
cache_invalidate_on_update : boolean ;
@@ -201,7 +200,7 @@ export interface GatewayDeleteResponse {
201
200
rate_limiting_technique ?: string ;
202
201
}
203
202
204
- export interface GatewayGetResponse {
203
+ export interface AIGatewayGetResponse {
205
204
id : string ;
206
205
207
206
cache_invalidate_on_update : boolean ;
@@ -225,7 +224,7 @@ export interface GatewayGetResponse {
225
224
rate_limiting_technique ?: string ;
226
225
}
227
226
228
- export interface GatewayCreateParams {
227
+ export interface AIGatewayCreateParams {
229
228
cache_invalidate_on_update : boolean ;
230
229
231
230
cache_ttl : number ;
@@ -243,7 +242,7 @@ export interface GatewayCreateParams {
243
242
rate_limiting_technique ?: string ;
244
243
}
245
244
246
- export interface GatewayUpdateParams {
245
+ export interface AIGatewayUpdateParams {
247
246
cache_invalidate_on_update : boolean ;
248
247
249
248
cache_ttl : number ;
@@ -261,7 +260,7 @@ export interface GatewayUpdateParams {
261
260
rate_limiting_technique ?: string ;
262
261
}
263
262
264
- export interface GatewayListParams extends V4PagePaginationArrayParams {
263
+ export interface AIGatewayListParams extends V4PagePaginationArrayParams {
265
264
id ?: string ;
266
265
267
266
/**
@@ -270,16 +269,7 @@ export interface GatewayListParams extends V4PagePaginationArrayParams {
270
269
order_by ?: string ;
271
270
}
272
271
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 {
283
273
export import Logs = LogsAPI . Logs ;
284
274
export import LogGetResponse = LogsAPI . LogGetResponse ;
285
275
export import LogGetParams = LogsAPI . LogGetParams ;
0 commit comments