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