cloudflare
Version:
The official TypeScript library for the Cloudflare API
99 lines • 3.02 kB
text/typescript
import { APIResource } from "../../core/resource.mjs";
import * as RulesAPI from "./rules/rules.mjs";
import { PagePromise, V4PagePaginationArray, type V4PagePaginationArrayParams } from "../../core/pagination.mjs";
import { RequestOptions } from "../../internal/request-options.mjs";
export declare class BaseAccountRules extends APIResource {
static readonly _key: readonly ['emailRouting', 'accountRules'];
/**
* Lists existing routing rules across all zones in the account or zone.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const accountRule of client.emailRouting.accountRules.list(
* { account_id: 'account_id' },
* )) {
* // ...
* }
* ```
*/
list(params?: AccountRuleListParams | null | undefined, options?: RequestOptions): PagePromise<AccountRulesV4PagePaginationArray, AccountRule>;
}
export declare class AccountRules extends BaseAccountRules {
}
export type AccountRulesV4PagePaginationArray = V4PagePaginationArray<AccountRule>;
export interface AccountRule {
/**
* Routing rule identifier.
*/
id?: string;
/**
* List actions patterns.
*/
actions?: Array<RulesAPI.Action>;
/**
* Routing rule status.
*/
enabled?: true | false;
/**
* Matching patterns to forward to your actions.
*/
matchers?: Array<RulesAPI.Matcher>;
/**
* Routing rule name.
*/
name?: string;
/**
* Priority of the routing rule.
*/
priority?: number;
/**
* Who manages the rule. `api` covers dashboard, generic API, and Terraform;
* `wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults to
* `api` when omitted on write.
*/
source?: 'api' | 'wrangler';
/**
* @deprecated Routing rule tag. (Deprecated, replaced by routing rule identifier)
*/
tag?: string;
/**
* Zone information for the routing rule.
*/
zone?: AccountRule.Zone;
}
export declare namespace AccountRule {
/**
* Zone information for the routing rule.
*/
interface Zone {
/**
* Zone name.
*/
name?: string;
/**
* Zone tag.
*/
tag?: string;
}
}
export interface AccountRuleListParams extends V4PagePaginationArrayParams {
/**
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
* Zone ID.
*/
account_id?: string;
/**
* Path param: The Zone ID to use for this endpoint. Mutually exclusive with the
* Account ID.
*/
zone_id?: string;
/**
* Query param: Filter by enabled routing rules.
*/
enabled?: true | false;
}
export declare namespace AccountRules {
export { type AccountRule as AccountRule, type AccountRulesV4PagePaginationArray as AccountRulesV4PagePaginationArray, type AccountRuleListParams as AccountRuleListParams, };
}
//# sourceMappingURL=account-rules.d.mts.map