UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

170 lines 5.33 kB
import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import * as ConfigsAPI from 'cloudflare/resources/hyperdrive/configs'; import * as HyperdriveAPI from 'cloudflare/resources/hyperdrive/hyperdrive'; import { HyperdrivesSinglePage } from 'cloudflare/resources/hyperdrive/hyperdrive'; export declare class Configs extends APIResource { /** * Creates and returns a new Hyperdrive configuration. */ create(params: ConfigCreateParams, options?: Core.RequestOptions): Core.APIPromise<HyperdriveAPI.Hyperdrive | null>; /** * Updates and returns the specified Hyperdrive configuration. */ update(hyperdriveId: string, params: ConfigUpdateParams, options?: Core.RequestOptions): Core.APIPromise<HyperdriveAPI.Hyperdrive | null>; /** * Returns a list of Hyperdrives */ list(params: ConfigListParams, options?: Core.RequestOptions): Core.PagePromise<HyperdrivesSinglePage, HyperdriveAPI.Hyperdrive>; /** * Deletes the specified Hyperdrive. */ delete(hyperdriveId: string, params: ConfigDeleteParams, options?: Core.RequestOptions): Core.APIPromise<ConfigDeleteResponse>; /** * Patches and returns the specified Hyperdrive configuration. Updates to the * origin and caching settings are applied with an all-or-nothing approach. */ edit(hyperdriveId: string, params: ConfigEditParams, options?: Core.RequestOptions): Core.APIPromise<HyperdriveAPI.Hyperdrive | null>; /** * Returns the specified Hyperdrive configuration. */ get(hyperdriveId: string, params: ConfigGetParams, options?: Core.RequestOptions): Core.APIPromise<HyperdriveAPI.Hyperdrive | null>; } export type ConfigDeleteResponse = unknown | string | null; export interface ConfigCreateParams { /** * Path param: Identifier */ account_id: string; /** * Body param: */ name: string; /** * Body param: */ origin: HyperdriveAPI.Configuration; /** * Body param: */ caching?: ConfigCreateParams.Caching; } export declare namespace ConfigCreateParams { interface Caching { /** * When set to true, disables the caching of SQL responses. (Default: false) */ disabled?: boolean; /** * When present, specifies max duration for which items should persist in the * cache. (Default: 60) */ max_age?: number; /** * When present, indicates the number of seconds cache may serve the response after * it becomes stale. (Default: 15) */ stale_while_revalidate?: number; } } export interface ConfigUpdateParams { /** * Path param: Identifier */ account_id: string; /** * Body param: */ name: string; /** * Body param: */ origin: HyperdriveAPI.Configuration; /** * Body param: */ caching?: ConfigUpdateParams.Caching; } export declare namespace ConfigUpdateParams { interface Caching { /** * When set to true, disables the caching of SQL responses. (Default: false) */ disabled?: boolean; /** * When present, specifies max duration for which items should persist in the * cache. (Default: 60) */ max_age?: number; /** * When present, indicates the number of seconds cache may serve the response after * it becomes stale. (Default: 15) */ stale_while_revalidate?: number; } } export interface ConfigListParams { /** * Identifier */ account_id: string; } export interface ConfigDeleteParams { /** * Identifier */ account_id: string; } export interface ConfigEditParams { /** * Path param: Identifier */ account_id: string; /** * Body param: */ caching?: ConfigEditParams.Caching; /** * Body param: */ name?: string; /** * Body param: */ origin?: HyperdriveAPI.Configuration; } export declare namespace ConfigEditParams { interface Caching { /** * When set to true, disables the caching of SQL responses. (Default: false) */ disabled?: boolean; /** * When present, specifies max duration for which items should persist in the * cache. (Default: 60) */ max_age?: number; /** * When present, indicates the number of seconds cache may serve the response after * it becomes stale. (Default: 15) */ stale_while_revalidate?: number; } } export interface ConfigGetParams { /** * Identifier */ account_id: string; } export declare namespace Configs { export import ConfigDeleteResponse = ConfigsAPI.ConfigDeleteResponse; export import ConfigCreateParams = ConfigsAPI.ConfigCreateParams; export import ConfigUpdateParams = ConfigsAPI.ConfigUpdateParams; export import ConfigListParams = ConfigsAPI.ConfigListParams; export import ConfigDeleteParams = ConfigsAPI.ConfigDeleteParams; export import ConfigEditParams = ConfigsAPI.ConfigEditParams; export import ConfigGetParams = ConfigsAPI.ConfigGetParams; } export { HyperdrivesSinglePage }; //# sourceMappingURL=configs.d.ts.map