-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): update via SDK Studio (#472)
- Loading branch information
1 parent
f28f0d7
commit edf2a7e
Showing
7 changed files
with
635 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
configured_endpoints: 1269 | ||
configured_endpoints: 1275 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-66b404214530cc73c44f34f297dad6bc8da0645b63e61d9d4fcbeb301e127e65.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,343 @@ | ||
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
import * as Core from 'cloudflare/core'; | ||
import { APIResource } from 'cloudflare/resource'; | ||
import * as LogsAPI from 'cloudflare/resources/ai-gateway/logs'; | ||
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination'; | ||
|
||
export class AIGateway extends APIResource { | ||
logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); | ||
|
||
/** | ||
* Create a new Gateway | ||
*/ | ||
create( | ||
params: AIGatewayCreateParams, | ||
options?: Core.RequestOptions, | ||
): Core.APIPromise<AIGatewayCreateResponse> { | ||
const { account_id, ...body } = params; | ||
return ( | ||
this._client.post(`/accounts/${account_id}/ai-gateway/gateways`, { | ||
body, | ||
...options, | ||
}) as Core.APIPromise<{ result: AIGatewayCreateResponse }> | ||
)._thenUnwrap((obj) => obj.result); | ||
} | ||
|
||
/** | ||
* Update a Gateway | ||
*/ | ||
update( | ||
id: string, | ||
params: AIGatewayUpdateParams, | ||
options?: Core.RequestOptions, | ||
): Core.APIPromise<AIGatewayUpdateResponse> { | ||
const { account_id, ...body } = params; | ||
return ( | ||
this._client.put(`/accounts/${account_id}/ai-gateway/gateways/${id}`, { | ||
body, | ||
...options, | ||
}) as Core.APIPromise<{ result: AIGatewayUpdateResponse }> | ||
)._thenUnwrap((obj) => obj.result); | ||
} | ||
|
||
/** | ||
* List Gateway's | ||
*/ | ||
list( | ||
params: AIGatewayListParams, | ||
options?: Core.RequestOptions, | ||
): Core.PagePromise<AIGatewayListResponsesV4PagePaginationArray, AIGatewayListResponse> { | ||
const { account_id, ...query } = params; | ||
return this._client.getAPIList( | ||
`/accounts/${account_id}/ai-gateway/gateways`, | ||
AIGatewayListResponsesV4PagePaginationArray, | ||
{ query, ...options }, | ||
); | ||
} | ||
|
||
/** | ||
* Delete a Gateway | ||
*/ | ||
delete( | ||
id: string, | ||
params: AIGatewayDeleteParams, | ||
options?: Core.RequestOptions, | ||
): Core.APIPromise<AIGatewayDeleteResponse> { | ||
const { account_id } = params; | ||
return ( | ||
this._client.delete(`/accounts/${account_id}/ai-gateway/gateways/${id}`, options) as Core.APIPromise<{ | ||
result: AIGatewayDeleteResponse; | ||
}> | ||
)._thenUnwrap((obj) => obj.result); | ||
} | ||
|
||
/** | ||
* Fetch a Gateway | ||
*/ | ||
get( | ||
id: string, | ||
params: AIGatewayGetParams, | ||
options?: Core.RequestOptions, | ||
): Core.APIPromise<AIGatewayGetResponse> { | ||
const { account_id } = params; | ||
return ( | ||
this._client.get(`/accounts/${account_id}/ai-gateway/gateways/${id}`, options) as Core.APIPromise<{ | ||
result: AIGatewayGetResponse; | ||
}> | ||
)._thenUnwrap((obj) => obj.result); | ||
} | ||
} | ||
|
||
export class AIGatewayListResponsesV4PagePaginationArray extends V4PagePaginationArray<AIGatewayListResponse> {} | ||
|
||
export interface AIGatewayCreateResponse { | ||
task: AIGatewayCreateResponse.Task; | ||
} | ||
|
||
export namespace AIGatewayCreateResponse { | ||
export interface Task { | ||
id: string; | ||
|
||
cache_invalidate_on_update: boolean; | ||
|
||
cache_ttl: number; | ||
|
||
collect_logs: boolean; | ||
|
||
created_at: string; | ||
|
||
modified_at: string; | ||
|
||
name: string; | ||
|
||
slug: string; | ||
|
||
rate_limiting_interval?: number; | ||
|
||
rate_limiting_limit?: number; | ||
|
||
rate_limiting_technique?: string; | ||
} | ||
} | ||
|
||
export interface AIGatewayUpdateResponse { | ||
id: string; | ||
|
||
cache_invalidate_on_update: boolean; | ||
|
||
cache_ttl: number; | ||
|
||
collect_logs: boolean; | ||
|
||
created_at: string; | ||
|
||
modified_at: string; | ||
|
||
name: string; | ||
|
||
slug: string; | ||
|
||
rate_limiting_interval?: number; | ||
|
||
rate_limiting_limit?: number; | ||
|
||
rate_limiting_technique?: string; | ||
} | ||
|
||
export interface AIGatewayListResponse { | ||
id: string; | ||
|
||
cache_invalidate_on_update: boolean; | ||
|
||
cache_ttl: number; | ||
|
||
collect_logs: boolean; | ||
|
||
created_at: string; | ||
|
||
modified_at: string; | ||
|
||
name: string; | ||
|
||
slug: string; | ||
|
||
rate_limiting_interval?: number; | ||
|
||
rate_limiting_limit?: number; | ||
|
||
rate_limiting_technique?: string; | ||
} | ||
|
||
export interface AIGatewayDeleteResponse { | ||
id: string; | ||
|
||
cache_invalidate_on_update: boolean; | ||
|
||
cache_ttl: number; | ||
|
||
collect_logs: boolean; | ||
|
||
created_at: string; | ||
|
||
modified_at: string; | ||
|
||
name: string; | ||
|
||
slug: string; | ||
|
||
rate_limiting_interval?: number; | ||
|
||
rate_limiting_limit?: number; | ||
|
||
rate_limiting_technique?: string; | ||
} | ||
|
||
export interface AIGatewayGetResponse { | ||
id: string; | ||
|
||
cache_invalidate_on_update: boolean; | ||
|
||
cache_ttl: number; | ||
|
||
collect_logs: boolean; | ||
|
||
created_at: string; | ||
|
||
modified_at: string; | ||
|
||
name: string; | ||
|
||
slug: string; | ||
|
||
rate_limiting_interval?: number; | ||
|
||
rate_limiting_limit?: number; | ||
|
||
rate_limiting_technique?: string; | ||
} | ||
|
||
export interface AIGatewayCreateParams { | ||
/** | ||
* Path param: | ||
*/ | ||
account_id: string; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
cache_invalidate_on_update: boolean; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
cache_ttl: number; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
collect_logs: boolean; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
name: string; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
slug: string; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
rate_limiting_interval?: number; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
rate_limiting_limit?: number; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
rate_limiting_technique?: string; | ||
} | ||
|
||
export interface AIGatewayUpdateParams { | ||
/** | ||
* Path param: | ||
*/ | ||
account_id: string; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
cache_invalidate_on_update: boolean; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
cache_ttl: number; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
collect_logs: boolean; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
name: string; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
slug: string; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
rate_limiting_interval?: number; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
rate_limiting_limit?: number; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
rate_limiting_technique?: string; | ||
} | ||
|
||
export interface AIGatewayListParams extends V4PagePaginationArrayParams { | ||
/** | ||
* Path param: | ||
*/ | ||
account_id: string; | ||
|
||
/** | ||
* Query param: | ||
*/ | ||
id?: string; | ||
|
||
/** | ||
* Query param: Order By Column Name | ||
*/ | ||
order_by?: string; | ||
} | ||
|
||
export interface AIGatewayDeleteParams { | ||
account_id: string; | ||
} | ||
|
||
export interface AIGatewayGetParams { | ||
account_id: string; | ||
} | ||
|
||
export namespace AIGateway { | ||
export import Logs = LogsAPI.Logs; | ||
export import LogGetResponse = LogsAPI.LogGetResponse; | ||
export import LogGetParams = LogsAPI.LogGetParams; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
export { AIGateway } from './ai-gateway'; | ||
export { Logs } from './logs'; | ||
export { LogGetResponse, LogGetParams, Logs } from './logs'; |
Oops, something went wrong.