cloudflare
Version:
The official TypeScript library for the Cloudflare API
511 lines • 12.4 kB
TypeScript
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as RulesAPI from 'cloudflare/resources/email-routing/rules/rules';
import * as CatchAllsAPI from 'cloudflare/resources/email-routing/rules/catch-alls';
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination';
export declare class Rules extends APIResource {
catchAlls: CatchAllsAPI.CatchAlls;
/**
* Rules consist of a set of criteria for matching emails (such as an email being
* sent to a specific custom email address) plus a set of actions to take on the
* email (like forwarding it to a specific destination address).
*/
create(zoneIdentifier: string, body: RuleCreateParams, options?: Core.RequestOptions): Core.APIPromise<RuleCreateResponse>;
/**
* Update actions and matches, or enable/disable specific routing rules.
*/
update(zoneIdentifier: string, ruleIdentifier: string, body: RuleUpdateParams, options?: Core.RequestOptions): Core.APIPromise<RuleUpdateResponse>;
/**
* Lists existing routing rules.
*/
list(zoneIdentifier: string, query?: RuleListParams, options?: Core.RequestOptions): Core.PagePromise<RuleListResponsesV4PagePaginationArray, RuleListResponse>;
list(zoneIdentifier: string, options?: Core.RequestOptions): Core.PagePromise<RuleListResponsesV4PagePaginationArray, RuleListResponse>;
/**
* Delete a specific routing rule.
*/
delete(zoneIdentifier: string, ruleIdentifier: string, options?: Core.RequestOptions): Core.APIPromise<RuleDeleteResponse>;
/**
* Get information for a specific routing rule already created.
*/
get(zoneIdentifier: string, ruleIdentifier: string, options?: Core.RequestOptions): Core.APIPromise<RuleGetResponse>;
}
export declare class RuleListResponsesV4PagePaginationArray extends V4PagePaginationArray<RuleListResponse> {
}
export interface EmailRules {
/**
* Routing rule identifier.
*/
id?: string;
/**
* List actions patterns.
*/
actions?: Array<EmailRules.Action>;
/**
* Routing rule status.
*/
enabled?: true | false;
/**
* Matching patterns to forward to your actions.
*/
matchers?: Array<EmailRules.Matcher>;
/**
* Routing rule name.
*/
name?: string;
/**
* Priority of the routing rule.
*/
priority?: number;
/**
* @deprecated: Routing rule tag. (Deprecated, replaced by routing rule identifier)
*/
tag?: string;
}
export declare namespace EmailRules {
/**
* Actions pattern.
*/
interface Action {
/**
* Type of supported action.
*/
type: 'drop' | 'forward' | 'worker';
value: Array<string>;
}
/**
* Matching pattern to forward your actions.
*/
interface Matcher {
/**
* Field for type matcher.
*/
field: 'to';
/**
* Type of matcher.
*/
type: 'literal';
/**
* Value for matcher.
*/
value: string;
}
}
export interface RuleCreateResponse {
/**
* Routing rule identifier.
*/
id?: string;
/**
* List actions patterns.
*/
actions?: Array<RuleCreateResponse.Action>;
/**
* Routing rule status.
*/
enabled?: true | false;
/**
* Matching patterns to forward to your actions.
*/
matchers?: Array<RuleCreateResponse.Matcher>;
/**
* Routing rule name.
*/
name?: string;
/**
* Priority of the routing rule.
*/
priority?: number;
/**
* @deprecated: Routing rule tag. (Deprecated, replaced by routing rule identifier)
*/
tag?: string;
}
export declare namespace RuleCreateResponse {
/**
* Actions pattern.
*/
interface Action {
/**
* Type of supported action.
*/
type: 'drop' | 'forward' | 'worker';
value: Array<string>;
}
/**
* Matching pattern to forward your actions.
*/
interface Matcher {
/**
* Field for type matcher.
*/
field: 'to';
/**
* Type of matcher.
*/
type: 'literal';
/**
* Value for matcher.
*/
value: string;
}
}
export interface RuleUpdateResponse {
/**
* Routing rule identifier.
*/
id?: string;
/**
* List actions patterns.
*/
actions?: Array<RuleUpdateResponse.Action>;
/**
* Routing rule status.
*/
enabled?: true | false;
/**
* Matching patterns to forward to your actions.
*/
matchers?: Array<RuleUpdateResponse.Matcher>;
/**
* Routing rule name.
*/
name?: string;
/**
* Priority of the routing rule.
*/
priority?: number;
/**
* @deprecated: Routing rule tag. (Deprecated, replaced by routing rule identifier)
*/
tag?: string;
}
export declare namespace RuleUpdateResponse {
/**
* Actions pattern.
*/
interface Action {
/**
* Type of supported action.
*/
type: 'drop' | 'forward' | 'worker';
value: Array<string>;
}
/**
* Matching pattern to forward your actions.
*/
interface Matcher {
/**
* Field for type matcher.
*/
field: 'to';
/**
* Type of matcher.
*/
type: 'literal';
/**
* Value for matcher.
*/
value: string;
}
}
export interface RuleListResponse {
/**
* Routing rule identifier.
*/
id?: string;
/**
* List actions patterns.
*/
actions?: Array<RuleListResponse.Action>;
/**
* Routing rule status.
*/
enabled?: true | false;
/**
* Matching patterns to forward to your actions.
*/
matchers?: Array<RuleListResponse.Matcher>;
/**
* Routing rule name.
*/
name?: string;
/**
* Priority of the routing rule.
*/
priority?: number;
/**
* @deprecated: Routing rule tag. (Deprecated, replaced by routing rule identifier)
*/
tag?: string;
}
export declare namespace RuleListResponse {
/**
* Actions pattern.
*/
interface Action {
/**
* Type of supported action.
*/
type: 'drop' | 'forward' | 'worker';
value: Array<string>;
}
/**
* Matching pattern to forward your actions.
*/
interface Matcher {
/**
* Field for type matcher.
*/
field: 'to';
/**
* Type of matcher.
*/
type: 'literal';
/**
* Value for matcher.
*/
value: string;
}
}
export interface RuleDeleteResponse {
/**
* Routing rule identifier.
*/
id?: string;
/**
* List actions patterns.
*/
actions?: Array<RuleDeleteResponse.Action>;
/**
* Routing rule status.
*/
enabled?: true | false;
/**
* Matching patterns to forward to your actions.
*/
matchers?: Array<RuleDeleteResponse.Matcher>;
/**
* Routing rule name.
*/
name?: string;
/**
* Priority of the routing rule.
*/
priority?: number;
/**
* @deprecated: Routing rule tag. (Deprecated, replaced by routing rule identifier)
*/
tag?: string;
}
export declare namespace RuleDeleteResponse {
/**
* Actions pattern.
*/
interface Action {
/**
* Type of supported action.
*/
type: 'drop' | 'forward' | 'worker';
value: Array<string>;
}
/**
* Matching pattern to forward your actions.
*/
interface Matcher {
/**
* Field for type matcher.
*/
field: 'to';
/**
* Type of matcher.
*/
type: 'literal';
/**
* Value for matcher.
*/
value: string;
}
}
export interface RuleGetResponse {
/**
* Routing rule identifier.
*/
id?: string;
/**
* List actions patterns.
*/
actions?: Array<RuleGetResponse.Action>;
/**
* Routing rule status.
*/
enabled?: true | false;
/**
* Matching patterns to forward to your actions.
*/
matchers?: Array<RuleGetResponse.Matcher>;
/**
* Routing rule name.
*/
name?: string;
/**
* Priority of the routing rule.
*/
priority?: number;
/**
* @deprecated: Routing rule tag. (Deprecated, replaced by routing rule identifier)
*/
tag?: string;
}
export declare namespace RuleGetResponse {
/**
* Actions pattern.
*/
interface Action {
/**
* Type of supported action.
*/
type: 'drop' | 'forward' | 'worker';
value: Array<string>;
}
/**
* Matching pattern to forward your actions.
*/
interface Matcher {
/**
* Field for type matcher.
*/
field: 'to';
/**
* Type of matcher.
*/
type: 'literal';
/**
* Value for matcher.
*/
value: string;
}
}
export interface RuleCreateParams {
/**
* List actions patterns.
*/
actions: Array<RuleCreateParams.Action>;
/**
* Matching patterns to forward to your actions.
*/
matchers: Array<RuleCreateParams.Matcher>;
/**
* Routing rule status.
*/
enabled?: true | false;
/**
* Routing rule name.
*/
name?: string;
/**
* Priority of the routing rule.
*/
priority?: number;
}
export declare namespace RuleCreateParams {
/**
* Actions pattern.
*/
interface Action {
/**
* Type of supported action.
*/
type: 'drop' | 'forward' | 'worker';
value: Array<string>;
}
/**
* Matching pattern to forward your actions.
*/
interface Matcher {
/**
* Field for type matcher.
*/
field: 'to';
/**
* Type of matcher.
*/
type: 'literal';
/**
* Value for matcher.
*/
value: string;
}
}
export interface RuleUpdateParams {
/**
* List actions patterns.
*/
actions: Array<RuleUpdateParams.Action>;
/**
* Matching patterns to forward to your actions.
*/
matchers: Array<RuleUpdateParams.Matcher>;
/**
* Routing rule status.
*/
enabled?: true | false;
/**
* Routing rule name.
*/
name?: string;
/**
* Priority of the routing rule.
*/
priority?: number;
}
export declare namespace RuleUpdateParams {
/**
* Actions pattern.
*/
interface Action {
/**
* Type of supported action.
*/
type: 'drop' | 'forward' | 'worker';
value: Array<string>;
}
/**
* Matching pattern to forward your actions.
*/
interface Matcher {
/**
* Field for type matcher.
*/
field: 'to';
/**
* Type of matcher.
*/
type: 'literal';
/**
* Value for matcher.
*/
value: string;
}
}
export interface RuleListParams extends V4PagePaginationArrayParams {
/**
* Filter by enabled routing rules.
*/
enabled?: true | false;
}
export declare namespace Rules {
export import EmailRules = RulesAPI.EmailRules;
export import RuleCreateResponse = RulesAPI.RuleCreateResponse;
export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse;
export import RuleListResponse = RulesAPI.RuleListResponse;
export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse;
export import RuleGetResponse = RulesAPI.RuleGetResponse;
export import RuleListResponsesV4PagePaginationArray = RulesAPI.RuleListResponsesV4PagePaginationArray;
export import RuleCreateParams = RulesAPI.RuleCreateParams;
export import RuleUpdateParams = RulesAPI.RuleUpdateParams;
export import RuleListParams = RulesAPI.RuleListParams;
export import CatchAlls = CatchAllsAPI.CatchAlls;
export import EmailCatchAllRule = CatchAllsAPI.EmailCatchAllRule;
export import CatchAllUpdateParams = CatchAllsAPI.CatchAllUpdateParams;
}
//# sourceMappingURL=rules.d.ts.map