cloudflare
Version:
The official TypeScript library for the Cloudflare API
159 lines • 4.39 kB
TypeScript
import { APIResource } from "../../resource.js";
import * as Core from "../../core.js";
import { SinglePage } from "../../pagination.js";
export declare class Rules extends APIResource {
/**
* Updates all snippet rules belonging to the zone.
*/
update(params: RuleUpdateParams, options?: Core.RequestOptions): Core.PagePromise<RuleUpdateResponsesSinglePage, RuleUpdateResponse>;
/**
* Fetches all snippet rules belonging to the zone.
*/
list(params: RuleListParams, options?: Core.RequestOptions): Core.PagePromise<RuleListResponsesSinglePage, RuleListResponse>;
/**
* Deletes all snippet rules belonging to the zone.
*/
delete(params: RuleDeleteParams, options?: Core.RequestOptions): Core.PagePromise<RuleDeleteResponsesSinglePage, RuleDeleteResponse>;
}
export declare class RuleUpdateResponsesSinglePage extends SinglePage<RuleUpdateResponse> {
}
export declare class RuleListResponsesSinglePage extends SinglePage<RuleListResponse> {
}
export declare class RuleDeleteResponsesSinglePage extends SinglePage<RuleDeleteResponse> {
}
/**
* A snippet rule.
*/
export interface RuleUpdateResponse {
/**
* The unique ID of the rule.
*/
id: string;
/**
* The expression defining which traffic will match the rule.
*/
expression: string;
/**
* The timestamp of when the rule was last modified.
*/
last_updated: string;
/**
* The identifying name of the snippet.
*/
snippet_name: string;
/**
* An informative description of the rule.
*/
description?: string;
/**
* Whether the rule should be executed.
*/
enabled?: boolean;
}
/**
* A snippet rule.
*/
export interface RuleListResponse {
/**
* The unique ID of the rule.
*/
id: string;
/**
* The expression defining which traffic will match the rule.
*/
expression: string;
/**
* The timestamp of when the rule was last modified.
*/
last_updated: string;
/**
* The identifying name of the snippet.
*/
snippet_name: string;
/**
* An informative description of the rule.
*/
description?: string;
/**
* Whether the rule should be executed.
*/
enabled?: boolean;
}
/**
* A snippet rule.
*/
export interface RuleDeleteResponse {
/**
* The unique ID of the rule.
*/
id: string;
/**
* The expression defining which traffic will match the rule.
*/
expression: string;
/**
* The timestamp of when the rule was last modified.
*/
last_updated: string;
/**
* The identifying name of the snippet.
*/
snippet_name: string;
/**
* An informative description of the rule.
*/
description?: string;
/**
* Whether the rule should be executed.
*/
enabled?: boolean;
}
export interface RuleUpdateParams {
/**
* Path param: The unique ID of the zone.
*/
zone_id: string;
/**
* Body param: A list of snippet rules.
*/
rules: Array<RuleUpdateParams.Rule>;
}
export declare namespace RuleUpdateParams {
/**
* A snippet rule.
*/
interface Rule {
/**
* The expression defining which traffic will match the rule.
*/
expression: string;
/**
* The identifying name of the snippet.
*/
snippet_name: string;
/**
* An informative description of the rule.
*/
description?: string;
/**
* Whether the rule should be executed.
*/
enabled?: boolean;
}
}
export interface RuleListParams {
/**
* The unique ID of the zone.
*/
zone_id: string;
}
export interface RuleDeleteParams {
/**
* The unique ID of the zone.
*/
zone_id: string;
}
export declare namespace Rules {
export { type RuleUpdateResponse as RuleUpdateResponse, type RuleListResponse as RuleListResponse, type RuleDeleteResponse as RuleDeleteResponse, RuleUpdateResponsesSinglePage as RuleUpdateResponsesSinglePage, RuleListResponsesSinglePage as RuleListResponsesSinglePage, RuleDeleteResponsesSinglePage as RuleDeleteResponsesSinglePage, type RuleUpdateParams as RuleUpdateParams, type RuleListParams as RuleListParams, type RuleDeleteParams as RuleDeleteParams, };
}
//# sourceMappingURL=rules.d.ts.map