cloudflare/cloudflare-typescript
Publicmirrored from https://github.com/cloudflare/cloudflare-typescriptAvailable
src/resources/ai-gateway/evaluation-types.ts
91lines · modecode
| 1 | // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | |
| 3 | import { APIResource } from '../../resource'; |
| 4 | import { isRequestOptions } from '../../core'; |
| 5 | import * as Core from '../../core'; |
| 6 | import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; |
| 7 | |
| 8 | export class EvaluationTypes extends APIResource { |
| 9 | /** |
| 10 | * List Evaluators |
| 11 | * |
| 12 | * @example |
| 13 | * ```ts |
| 14 | * // Automatically fetches more pages as needed. |
| 15 | * for await (const evaluationTypeListResponse of client.aiGateway.evaluationTypes.list( |
| 16 | * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, |
| 17 | * )) { |
| 18 | * // ... |
| 19 | * } |
| 20 | * ``` |
| 21 | */ |
| 22 | list( |
| 23 | params?: EvaluationTypeListParams, |
| 24 | options?: Core.RequestOptions, |
| 25 | ): Core.PagePromise<EvaluationTypeListResponsesV4PagePaginationArray, EvaluationTypeListResponse>; |
| 26 | list( |
| 27 | options?: Core.RequestOptions, |
| 28 | ): Core.PagePromise<EvaluationTypeListResponsesV4PagePaginationArray, EvaluationTypeListResponse>; |
| 29 | list( |
| 30 | params: EvaluationTypeListParams | Core.RequestOptions = {}, |
| 31 | options?: Core.RequestOptions, |
| 32 | ): Core.PagePromise<EvaluationTypeListResponsesV4PagePaginationArray, EvaluationTypeListResponse> { |
| 33 | if (isRequestOptions(params)) { |
| 34 | return this.list({}, params); |
| 35 | } |
| 36 | const { account_id = this._client.accountId, ...query } = params; |
| 37 | return this._client.getAPIList( |
| 38 | `/accounts/${account_id}/ai-gateway/evaluation-types`, |
| 39 | EvaluationTypeListResponsesV4PagePaginationArray, |
| 40 | { query, ...options }, |
| 41 | ); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | export class EvaluationTypeListResponsesV4PagePaginationArray extends V4PagePaginationArray<EvaluationTypeListResponse> {} |
| 46 | |
| 47 | export interface EvaluationTypeListResponse { |
| 48 | id: string; |
| 49 | |
| 50 | created_at: string; |
| 51 | |
| 52 | description: string; |
| 53 | |
| 54 | enable: boolean; |
| 55 | |
| 56 | mandatory: boolean; |
| 57 | |
| 58 | modified_at: string; |
| 59 | |
| 60 | name: string; |
| 61 | |
| 62 | type: string; |
| 63 | } |
| 64 | |
| 65 | export interface EvaluationTypeListParams extends V4PagePaginationArrayParams { |
| 66 | /** |
| 67 | * Path param |
| 68 | */ |
| 69 | account_id?: string; |
| 70 | |
| 71 | /** |
| 72 | * Query param |
| 73 | */ |
| 74 | order_by?: string; |
| 75 | |
| 76 | /** |
| 77 | * Query param |
| 78 | */ |
| 79 | order_by_direction?: 'asc' | 'desc'; |
| 80 | } |
| 81 | |
| 82 | EvaluationTypes.EvaluationTypeListResponsesV4PagePaginationArray = |
| 83 | EvaluationTypeListResponsesV4PagePaginationArray; |
| 84 | |
| 85 | export declare namespace EvaluationTypes { |
| 86 | export { |
| 87 | type EvaluationTypeListResponse as EvaluationTypeListResponse, |
| 88 | EvaluationTypeListResponsesV4PagePaginationArray as EvaluationTypeListResponsesV4PagePaginationArray, |
| 89 | type EvaluationTypeListParams as EvaluationTypeListParams, |
| 90 | }; |
| 91 | } |
| 92 | |