import { APIResource } from "../../../core/resource.mjs"; import * as CatchAllsAPI from "./catch-alls.mjs"; import { BaseCatchAlls, CatchAllAction, CatchAllGetParams, CatchAllGetResponse, CatchAllMatcher, CatchAllUpdateParams, CatchAllUpdateResponse, CatchAlls } from "./catch-alls.mjs"; import { APIPromise } from "../../../core/api-promise.mjs"; import { RequestOptions } from "../../../internal/request-options.mjs"; export declare class BaseRules extends APIResource { static readonly _key: readonly ['emailRouting', 'rules']; /** * 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). Forward actions * require all destination addresses to be verified. * * @example * ```ts * const emailRoutingRule = * await client.emailRouting.rules.create({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * actions: [{ type: 'forward' }], * matchers: [{ type: 'literal' }], * }); * ``` */ create(params: RuleCreateParams, options?: RequestOptions): APIPromise; /** * Update actions and matches, or enable/disable specific routing rules. Forward * actions require all destination addresses to be verified. * * @example * ```ts * const emailRoutingRule = * await client.emailRouting.rules.update( * 'a7e6fb77503c41d8a7f3113c6918f10c', * { * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * actions: [{ type: 'forward' }], * matchers: [{ type: 'literal' }], * }, * ); * ``` */ update(ruleIdentifier: string, params: RuleUpdateParams, options?: RequestOptions): APIPromise; /** * Delete a specific routing rule. * * @example * ```ts * const emailRoutingRule = * await client.emailRouting.rules.delete( * 'a7e6fb77503c41d8a7f3113c6918f10c', * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ delete(ruleIdentifier: string, params: RuleDeleteParams, options?: RequestOptions): APIPromise; /** * Get information for a specific routing rule already created. * * @example * ```ts * const emailRoutingRule = * await client.emailRouting.rules.get( * 'a7e6fb77503c41d8a7f3113c6918f10c', * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ get(ruleIdentifier: string, params: RuleGetParams, options?: RequestOptions): APIPromise; } export declare class Rules extends BaseRules { catchAlls: CatchAllsAPI.CatchAlls; } /** * Actions pattern. */ export interface Action { /** * Type of supported action. */ type: 'drop' | 'forward' | 'worker'; value?: Array; } /** * Actions pattern. */ export interface ActionParam { /** * Type of supported action. */ type: 'drop' | 'forward' | 'worker'; value?: Array; } export interface EmailRoutingRule { /** * Routing rule identifier. */ id?: string; /** * List actions patterns. */ actions?: Array; /** * Routing rule status. */ enabled?: true | false; /** * Matching patterns to forward to your actions. */ matchers?: Array; /** * Routing rule name. */ name?: string; /** * Priority of the routing rule. */ priority?: number; /** * @deprecated Routing rule tag. (Deprecated, replaced by routing rule identifier) */ tag?: string; } /** * Matching pattern to forward your actions. */ export interface Matcher { /** * Type of matcher. */ type: 'all' | 'literal'; /** * Field for type matcher. */ field?: 'to'; /** * Value for matcher. */ value?: string; } /** * Matching pattern to forward your actions. */ export interface MatcherParam { /** * Type of matcher. */ type: 'all' | 'literal'; /** * Field for type matcher. */ field?: 'to'; /** * Value for matcher. */ value?: string; } export interface RuleCreateParams { /** * Path param: Identifier. */ zone_id: string; /** * Body param: List actions patterns. */ actions: Array; /** * Body param: Matching patterns to forward to your actions. */ matchers: Array; /** * Body param: Routing rule status. */ enabled?: true | false; /** * Body param: Routing rule name. */ name?: string; /** * Body param: Priority of the routing rule. */ priority?: number; } export interface RuleUpdateParams { /** * Path param: Identifier. */ zone_id: string; /** * Body param: List actions patterns. */ actions: Array; /** * Body param: Matching patterns to forward to your actions. */ matchers: Array; /** * Body param: Routing rule status. */ enabled?: true | false; /** * Body param: Routing rule name. */ name?: string; /** * Body param: Priority of the routing rule. */ priority?: number; } export interface RuleDeleteParams { /** * Identifier. */ zone_id: string; } export interface RuleGetParams { /** * Identifier. */ zone_id: string; } export declare namespace Rules { export { type Action as Action, type EmailRoutingRule as EmailRoutingRule, type Matcher as Matcher, type RuleCreateParams as RuleCreateParams, type RuleUpdateParams as RuleUpdateParams, type RuleDeleteParams as RuleDeleteParams, type RuleGetParams as RuleGetParams, }; export { CatchAlls as CatchAlls, BaseCatchAlls as BaseCatchAlls, type CatchAllAction as CatchAllAction, type CatchAllMatcher as CatchAllMatcher, type CatchAllUpdateResponse as CatchAllUpdateResponse, type CatchAllGetResponse as CatchAllGetResponse, type CatchAllUpdateParams as CatchAllUpdateParams, type CatchAllGetParams as CatchAllGetParams, }; } //# sourceMappingURL=rules.d.mts.map