cloudflare/cloudflare-typescript

Public

mirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v4.0.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/resources/api-gateway/schemas.ts

47lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import { APIResource } from '../../resource';
4import * as Core from '../../core';
5
6export class Schemas extends APIResource {
7 /**
8 * Retrieve operations and features as OpenAPI schemas
9 */
10 list(params: SchemaListParams, options?: Core.RequestOptions): Core.APIPromise<SchemaListResponse> {
11 const { zone_id, ...query } = params;
12 return (
13 this._client.get(`/zones/${zone_id}/api_gateway/schemas`, { query, ...options }) as Core.APIPromise<{
14 result: SchemaListResponse;
15 }>
16 )._thenUnwrap((obj) => obj.result);
17 }
18}
19
20export interface SchemaListResponse {
21 schemas?: Array<unknown>;
22
23 timestamp?: string;
24}
25
26export interface SchemaListParams {
27 /**
28 * Path param: Identifier
29 */
30 zone_id: string;
31
32 /**
33 * Query param: Add feature(s) to the results. The feature name that is given here
34 * corresponds to the resulting feature object. Have a look at the top-level object
35 * description for more details on the specific meaning.
36 */
37 feature?: Array<'thresholds' | 'parameter_schemas' | 'schema_info'>;
38
39 /**
40 * Query param: Receive schema only for the given host(s).
41 */
42 host?: Array<string>;
43}
44
45export declare namespace Schemas {
46 export { type SchemaListResponse as SchemaListResponse, type SchemaListParams as SchemaListParams };
47}
48