UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

159 lines 5.46 kB
import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import * as RulesAPI from 'cloudflare/resources/waiting-rooms/rules'; import { SinglePage } from 'cloudflare/pagination'; export declare class Rules extends APIResource { /** * Only available for the Waiting Room Advanced subscription. Creates a rule for a * waiting room. */ create(zoneIdentifier: string, waitingRoomId: string, body: RuleCreateParams, options?: Core.RequestOptions): Core.APIPromise<RuleCreateResponse | null>; /** * Only available for the Waiting Room Advanced subscription. Replaces all rules * for a waiting room. */ update(zoneIdentifier: string, waitingRoomId: string, body: RuleUpdateParams, options?: Core.RequestOptions): Core.APIPromise<RuleUpdateResponse | null>; /** * Lists rules for a waiting room. */ list(zoneIdentifier: string, waitingRoomId: string, options?: Core.RequestOptions): Core.PagePromise<WaitingroomRulesSinglePage, WaitingroomRule>; /** * Deletes a rule for a waiting room. */ delete(zoneIdentifier: string, waitingRoomId: string, ruleId: string, options?: Core.RequestOptions): Core.APIPromise<RuleDeleteResponse | null>; /** * Patches a rule for a waiting room. */ edit(zoneIdentifier: string, waitingRoomId: string, ruleId: string, body: RuleEditParams, options?: Core.RequestOptions): Core.APIPromise<RuleEditResponse | null>; } export declare class WaitingroomRulesSinglePage extends SinglePage<WaitingroomRule> { } export interface WaitingroomRule { /** * The ID of the rule. */ id?: string; /** * The action to take when the expression matches. */ action?: 'bypass_waiting_room'; /** * The description of the rule. */ description?: string; /** * When set to true, the rule is enabled. */ enabled?: boolean; /** * Criteria defining when there is a match for the current rule. */ expression?: string; last_updated?: string; /** * The version of the rule. */ version?: string; } export type RuleCreateResponse = Array<WaitingroomRule>; export type RuleUpdateResponse = Array<WaitingroomRule>; export type RuleDeleteResponse = Array<WaitingroomRule>; export type RuleEditResponse = Array<WaitingroomRule>; export interface RuleCreateParams { /** * The action to take when the expression matches. */ action: 'bypass_waiting_room'; /** * Criteria defining when there is a match for the current rule. */ expression: string; /** * The description of the rule. */ description?: string; /** * When set to true, the rule is enabled. */ enabled?: boolean; } export type RuleUpdateParams = Array<RuleUpdateParams.Body>; export declare namespace RuleUpdateParams { interface Body { /** * The action to take when the expression matches. */ action: 'bypass_waiting_room'; /** * Criteria defining when there is a match for the current rule. */ expression: string; /** * The description of the rule. */ description?: string; /** * When set to true, the rule is enabled. */ enabled?: boolean; } } export interface RuleEditParams { /** * The action to take when the expression matches. */ action: 'bypass_waiting_room'; /** * Criteria defining when there is a match for the current rule. */ expression: string; /** * The description of the rule. */ description?: string; /** * When set to true, the rule is enabled. */ enabled?: boolean; /** * Reorder the position of a rule */ position?: RuleEditParams.Index | RuleEditParams.Before | RuleEditParams.After; } export declare namespace RuleEditParams { interface Index { /** * Places the rule in the exact position specified by the integer number * <POSITION_NUMBER>. Position numbers start with 1. Existing rules in the ruleset * from the specified position number onward are shifted one position (no rule is * overwritten). */ index?: number; } interface Before { /** * Places the rule before rule <RULE_ID>. Use this argument with an empty rule ID * value ("") to set the rule as the first rule in the ruleset. */ before?: string; } interface After { /** * Places the rule after rule <RULE_ID>. Use this argument with an empty rule ID * value ("") to set the rule as the last rule in the ruleset. */ after?: string; } } export declare namespace Rules { export import WaitingroomRule = RulesAPI.WaitingroomRule; export import RuleCreateResponse = RulesAPI.RuleCreateResponse; export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; export import RuleEditResponse = RulesAPI.RuleEditResponse; export import WaitingroomRulesSinglePage = RulesAPI.WaitingroomRulesSinglePage; export import RuleCreateParams = RulesAPI.RuleCreateParams; export import RuleUpdateParams = RulesAPI.RuleUpdateParams; export import RuleEditParams = RulesAPI.RuleEditParams; } //# sourceMappingURL=rules.d.ts.map