cloudflare/cloudflare-typescript
Publicmirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable
src/resources/api-gateway/schemas.ts
49lines · 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 * as SchemasAPI from './schemas'; |
| 6 | |
| 7 | export class Schemas extends APIResource { |
| 8 | /** |
| 9 | * Retrieve operations and features as OpenAPI schemas |
| 10 | */ |
| 11 | list(params: SchemaListParams, options?: Core.RequestOptions): Core.APIPromise<SchemaListResponse> { |
| 12 | const { zone_id, ...query } = params; |
| 13 | return ( |
| 14 | this._client.get(`/zones/${zone_id}/api_gateway/schemas`, { query, ...options }) as Core.APIPromise<{ |
| 15 | result: SchemaListResponse; |
| 16 | }> |
| 17 | )._thenUnwrap((obj) => obj.result); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | export interface SchemaListResponse { |
| 22 | schemas?: Array<unknown>; |
| 23 | |
| 24 | timestamp?: string; |
| 25 | } |
| 26 | |
| 27 | export interface SchemaListParams { |
| 28 | /** |
| 29 | * Path param: Identifier |
| 30 | */ |
| 31 | zone_id: string; |
| 32 | |
| 33 | /** |
| 34 | * Query param: Add feature(s) to the results. The feature name that is given here |
| 35 | * corresponds to the resulting feature object. Have a look at the top-level object |
| 36 | * description for more details on the specific meaning. |
| 37 | */ |
| 38 | feature?: Array<'thresholds' | 'parameter_schemas' | 'schema_info'>; |
| 39 | |
| 40 | /** |
| 41 | * Query param: Receive schema only for the given host(s). |
| 42 | */ |
| 43 | host?: Array<string>; |
| 44 | } |
| 45 | |
| 46 | export namespace Schemas { |
| 47 | export import SchemaListResponse = SchemasAPI.SchemaListResponse; |
| 48 | export import SchemaListParams = SchemasAPI.SchemaListParams; |
| 49 | } |
| 50 | |