// AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit. import * as S from "@distilled.cloud/core/schema"; import * as API from "@distilled.cloud/core/api"; import * as T from "../traits.ts"; import { CloudflareProtocol, CloudflarePaginatedProtocol, type CloudflareOpError, type CloudflareOpContext, } from "../protocol.ts"; import { cloudflarePaginate, ResultInfo } from "../pagination.ts"; import { CloudflareError, CloudflareRateLimited } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { CloudflareOpError, CloudflareOpContext }; /** Fallback camelCase→wire mapping for opaque content (mined from the distilled SDK). */ const KEY_DICTIONARY: Record> = { documentationUrl: "documentation_url", perPage: "per_page", resultInfo: "result_info", skipWizard: "skip_wizard", supportSubaddress: "support_subaddress", totalCount: "total_count", totalPages: "total_pages", }; export class DestinationNotVerified extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "DestinationNotVerified", { code: S.Number, message: S.String, }, ), [{ code: 2054 }], ) {} export class EmailAddressCreatedTooRecently extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "EmailAddressCreatedTooRecently", { code: S.Number, message: S.String, }, ), [{ code: 2032 }], ) {} export class EmailAddressNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "EmailAddressNotFound", { code: S.Number, message: S.String, }, ), [{ code: 2015 }], ) {} export class EmailRoutingRuleNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "EmailRoutingRuleNotFound", { code: S.Number, message: S.String, }, ), [{ status: 404 }], ) {} export class Forbidden extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Forbidden", { code: S.Number, message: S.String, }), [{ status: 403 }], ) {} export class WorkerScriptNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "WorkerScriptNotFound", { code: S.Number, message: S.String, }, ), [{ code: 2016 }], ) {} export interface CreateAddressRequest { /** Identifier. */ accountId: string; /** The contact email address of the user. */ email: string; } export const CreateAddressRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), email: S.String, }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/email/routing/addresses", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateAddressRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateAddressResponse { /** Destination address identifier. */ id?: string | null; /** The date and time the destination address has been created. */ created?: string | null; /** The contact email address of the user. */ email?: string | null; /** The date and time the destination address was last modified. */ modified?: string | null; /** Destination address tag. (Deprecated, replaced by destination address identifier) */ tag?: string | null; /** The date and time the destination address has been verified. Null means not verified yet. */ verified?: string | null; } export const CreateAddressResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), created: S.optional(S.NullOr(S.String)), email: S.optional(S.NullOr(S.String)), modified: S.optional(S.NullOr(S.String)), tag: S.optional(S.NullOr(S.String)), verified: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateAddressResponse", }) as any as S.Schema; export interface CreateDnsRequest { /** Identifier. */ zoneId: string; /** Domain of your zone. */ name?: string; } export const CreateDnsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), name: S.optional(S.String), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/email/routing/dns", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateDnsRequest", }) as any as S.Schema; export type DnsCreateResponseStatus = | "ready" | "unconfigured" | "misconfigured" | "misconfigured/locked" | "unlocked"; export const DnsCreateResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateDnsResponse { /** Email Routing settings identifier. */ id: string; /** State of the zone settings for Email Routing. */ enabled: boolean; /** Domain of your zone. */ name: string; /** The date and time the settings have been created. */ created?: string | null; /** The date and time the settings have been modified. */ modified?: string | null; /** Flag to check if the user skipped the configuration wizard. */ skipWizard?: boolean | null; /** Show the state of your account, and the type or configuration error. */ status?: DnsCreateResponseStatus | null; /** Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules. */ supportSubaddress?: boolean | null; /** Email Routing settings tag. (Deprecated, replaced by Email Routing settings identifier) */ tag?: string | null; } export const CreateDnsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, enabled: S.Boolean, name: S.String, created: S.optional(S.NullOr(S.String)), modified: S.optional(S.NullOr(S.String)), skipWizard: S.optional(S.NullOr(S.Boolean).pipe(T.Body("skip_wizard"))), status: S.optional(S.NullOr(DnsCreateResponseStatus)), supportSubaddress: S.optional( S.NullOr(S.Boolean).pipe(T.Body("support_subaddress")), ), tag: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateDnsResponse", }) as any as S.Schema; export type RulesCreateRequestActionsItemType = "drop" | "forward" | "worker"; export const RulesCreateRequestActionsItemType = /*@__PURE__*/ S.String; export type RulesCreateRequestActionsItemValueList = Array; export const RulesCreateRequestActionsItemValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface RulesCreateRequestActionsItem { /** Type of supported action. */ type: RulesCreateRequestActionsItemType | (string & {}); value?: RulesCreateRequestActionsItemValueList; } export const RulesCreateRequestActionsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: RulesCreateRequestActionsItemType, value: S.optional(RulesCreateRequestActionsItemValueList), }), ).annotate({ identifier: "RulesCreateRequestActionsItem", }) as any as S.Schema; export type RulesCreateRequestActionsList = Array; export const RulesCreateRequestActionsList = /*@__PURE__*/ S.Array( RulesCreateRequestActionsItem, ) as any as S.Schema; export type RulesCreateRequestMatchersItemType = "all" | "literal"; export const RulesCreateRequestMatchersItemType = /*@__PURE__*/ S.String; export type RulesCreateRequestMatchersItemField = "to"; export const RulesCreateRequestMatchersItemField = /*@__PURE__*/ S.String; export interface RulesCreateRequestMatchersItem { /** Type of matcher. */ type: RulesCreateRequestMatchersItemType | (string & {}); /** Field for type matcher. */ field?: RulesCreateRequestMatchersItemField | (string & {}); /** Value for matcher. */ value?: string; } export const RulesCreateRequestMatchersItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: RulesCreateRequestMatchersItemType, field: S.optional(RulesCreateRequestMatchersItemField), value: S.optional(S.String), }), ).annotate({ identifier: "RulesCreateRequestMatchersItem", }) as any as S.Schema; export type RulesCreateRequestMatchersList = Array; export const RulesCreateRequestMatchersList = /*@__PURE__*/ S.Array( RulesCreateRequestMatchersItem, ) as any as S.Schema; export type RulesCreateRequestSource = "api" | "wrangler"; export const RulesCreateRequestSource = /*@__PURE__*/ S.String; export interface CreateRuleRequest { /** Identifier. */ zoneId: string; /** List actions patterns. */ actions: RulesCreateRequestActionsList; /** Matching patterns to forward to your actions. */ matchers: RulesCreateRequestMatchersList; /** Routing rule status. */ enabled?: boolean; /** Routing rule name. */ name?: string; /** Public tag (script_tag) of the Worker that owns this rule. Required when */ ownerWorkerTag?: string; /** Priority of the routing rule. */ priority?: number; /** Who manages the rule. `api` covers dashboard, generic API, and Terraform; */ source?: RulesCreateRequestSource | (string & {}); } export const CreateRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), actions: RulesCreateRequestActionsList, matchers: RulesCreateRequestMatchersList, enabled: S.optional(S.Boolean), name: S.optional(S.String), ownerWorkerTag: S.optional(S.String.pipe(T.Body("owner_worker_tag"))), priority: S.optional(S.Number), source: S.optional(RulesCreateRequestSource), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/email/routing/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateRuleRequest", }) as any as S.Schema; export type RulesCreateResponseActionsItemType = "drop" | "forward" | "worker"; export const RulesCreateResponseActionsItemType = /*@__PURE__*/ S.String; export type RulesCreateResponseActionsItemValueList = Array; export const RulesCreateResponseActionsItemValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface RulesCreateResponseActionsItem { /** Type of supported action. */ type: RulesCreateResponseActionsItemType; value?: RulesCreateResponseActionsItemValueList | null; } export const RulesCreateResponseActionsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: RulesCreateResponseActionsItemType, value: S.optional(S.NullOr(RulesCreateResponseActionsItemValueList)), }), ).annotate({ identifier: "RulesCreateResponseActionsItem", }) as any as S.Schema; export type RulesCreateResponseActionsList = Array; export const RulesCreateResponseActionsList = /*@__PURE__*/ S.Array( RulesCreateResponseActionsItem, ) as any as S.Schema; export type RulesCreateResponseMatchersItemType = "all" | "literal"; export const RulesCreateResponseMatchersItemType = /*@__PURE__*/ S.String; export type RulesCreateResponseMatchersItemField = "to"; export const RulesCreateResponseMatchersItemField = /*@__PURE__*/ S.String; export interface RulesCreateResponseMatchersItem { /** Type of matcher. */ type: RulesCreateResponseMatchersItemType; /** Field for type matcher. */ field?: RulesCreateResponseMatchersItemField | null; /** Value for matcher. */ value?: string | null; } export const RulesCreateResponseMatchersItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: RulesCreateResponseMatchersItemType, field: S.optional(S.NullOr(RulesCreateResponseMatchersItemField)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesCreateResponseMatchersItem", }) as any as S.Schema; export type RulesCreateResponseMatchersList = Array; export const RulesCreateResponseMatchersList = /*@__PURE__*/ S.Array( RulesCreateResponseMatchersItem, ) as any as S.Schema; export type RulesCreateResponseSource = "api" | "wrangler"; export const RulesCreateResponseSource = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateRuleResponse { /** Routing rule identifier. */ id?: string | null; /** List actions patterns. */ actions?: RulesCreateResponseActionsList | null; /** Routing rule status. */ enabled?: boolean | null; /** Matching patterns to forward to your actions. */ matchers?: RulesCreateResponseMatchersList | null; /** Routing rule name. */ name?: string | null; /** Priority of the routing rule. */ priority?: number | null; /** Who manages the rule. `api` covers dashboard, generic API, and Terraform; */ source?: RulesCreateResponseSource | null; /** Routing rule tag. (Deprecated, replaced by routing rule identifier) */ tag?: string | null; } export const CreateRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), actions: S.optional(S.NullOr(RulesCreateResponseActionsList)), enabled: S.optional(S.NullOr(S.Boolean)), matchers: S.optional(S.NullOr(RulesCreateResponseMatchersList)), name: S.optional(S.NullOr(S.String)), priority: S.optional(S.NullOr(S.Number)), source: S.optional(S.NullOr(RulesCreateResponseSource)), tag: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateRuleResponse", }) as any as S.Schema; export interface DeleteAddressRequest { /** Identifier. */ accountId: string; /** Destination address identifier. */ destinationAddressIdentifier: string; } export const DeleteAddressRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), destinationAddressIdentifier: S.String.pipe( T.Label("destination_address_identifier"), ), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/email/routing/addresses/{destination_address_identifier}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteAddressRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteAddressResponse { /** Destination address identifier. */ id?: string | null; /** The date and time the destination address has been created. */ created?: string | null; /** The contact email address of the user. */ email?: string | null; /** The date and time the destination address was last modified. */ modified?: string | null; /** Destination address tag. (Deprecated, replaced by destination address identifier) */ tag?: string | null; /** The date and time the destination address has been verified. Null means not verified yet. */ verified?: string | null; } export const DeleteAddressResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), created: S.optional(S.NullOr(S.String)), email: S.optional(S.NullOr(S.String)), modified: S.optional(S.NullOr(S.String)), tag: S.optional(S.NullOr(S.String)), verified: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteAddressResponse", }) as any as S.Schema; export interface DeleteDnsRequest { /** Identifier. */ zoneId: string; } export const DeleteDnsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/email/routing/dns", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteDnsRequest", }) as any as S.Schema; export interface DeleteDnsResponse {} export const DeleteDnsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteDnsResponse", }) as any as S.Schema; export interface DeleteRuleRequest { /** Identifier. */ zoneId: string; /** Routing rule identifier. */ ruleIdentifier: string; } export const DeleteRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), ruleIdentifier: S.String.pipe(T.Label("rule_identifier")), }) .pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/email/routing/rules/{rule_identifier}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteRuleRequest", }) as any as S.Schema; export type RulesDeleteResponseActionsItemType = "drop" | "forward" | "worker"; export const RulesDeleteResponseActionsItemType = /*@__PURE__*/ S.String; export type RulesDeleteResponseActionsItemValueList = Array; export const RulesDeleteResponseActionsItemValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface RulesDeleteResponseActionsItem { /** Type of supported action. */ type: RulesDeleteResponseActionsItemType; value?: RulesDeleteResponseActionsItemValueList | null; } export const RulesDeleteResponseActionsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: RulesDeleteResponseActionsItemType, value: S.optional(S.NullOr(RulesDeleteResponseActionsItemValueList)), }), ).annotate({ identifier: "RulesDeleteResponseActionsItem", }) as any as S.Schema; export type RulesDeleteResponseActionsList = Array; export const RulesDeleteResponseActionsList = /*@__PURE__*/ S.Array( RulesDeleteResponseActionsItem, ) as any as S.Schema; export type RulesDeleteResponseMatchersItemType = "all" | "literal"; export const RulesDeleteResponseMatchersItemType = /*@__PURE__*/ S.String; export type RulesDeleteResponseMatchersItemField = "to"; export const RulesDeleteResponseMatchersItemField = /*@__PURE__*/ S.String; export interface RulesDeleteResponseMatchersItem { /** Type of matcher. */ type: RulesDeleteResponseMatchersItemType; /** Field for type matcher. */ field?: RulesDeleteResponseMatchersItemField | null; /** Value for matcher. */ value?: string | null; } export const RulesDeleteResponseMatchersItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: RulesDeleteResponseMatchersItemType, field: S.optional(S.NullOr(RulesDeleteResponseMatchersItemField)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesDeleteResponseMatchersItem", }) as any as S.Schema; export type RulesDeleteResponseMatchersList = Array; export const RulesDeleteResponseMatchersList = /*@__PURE__*/ S.Array( RulesDeleteResponseMatchersItem, ) as any as S.Schema; export type RulesDeleteResponseSource = "api" | "wrangler"; export const RulesDeleteResponseSource = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteRuleResponse { /** Routing rule identifier. */ id?: string | null; /** List actions patterns. */ actions?: RulesDeleteResponseActionsList | null; /** Routing rule status. */ enabled?: boolean | null; /** Matching patterns to forward to your actions. */ matchers?: RulesDeleteResponseMatchersList | null; /** Routing rule name. */ name?: string | null; /** Priority of the routing rule. */ priority?: number | null; /** Who manages the rule. `api` covers dashboard, generic API, and Terraform; */ source?: RulesDeleteResponseSource | null; /** Routing rule tag. (Deprecated, replaced by routing rule identifier) */ tag?: string | null; } export const DeleteRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), actions: S.optional(S.NullOr(RulesDeleteResponseActionsList)), enabled: S.optional(S.NullOr(S.Boolean)), matchers: S.optional(S.NullOr(RulesDeleteResponseMatchersList)), name: S.optional(S.NullOr(S.String)), priority: S.optional(S.NullOr(S.Number)), source: S.optional(S.NullOr(RulesDeleteResponseSource)), tag: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteRuleResponse", }) as any as S.Schema; export interface DisableEmailRoutingRequest { /** Identifier. */ zoneId: string; } export const DisableEmailRoutingRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/email/routing/disable", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DisableEmailRoutingRequest", }) as any as S.Schema; export type DisableResponseStatus = | "ready" | "unconfigured" | "misconfigured" | "misconfigured/locked" | "unlocked"; export const DisableResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DisableEmailRoutingResponse { /** Email Routing settings identifier. */ id: string; /** State of the zone settings for Email Routing. */ enabled: boolean; /** Domain of your zone. */ name: string; /** The date and time the settings have been created. */ created?: string | null; /** The date and time the settings have been modified. */ modified?: string | null; /** Flag to check if the user skipped the configuration wizard. */ skipWizard?: boolean | null; /** Show the state of your account, and the type or configuration error. */ status?: DisableResponseStatus | null; /** Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules. */ supportSubaddress?: boolean | null; /** Email Routing settings tag. (Deprecated, replaced by Email Routing settings identifier) */ tag?: string | null; } export const DisableEmailRoutingResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, enabled: S.Boolean, name: S.String, created: S.optional(S.NullOr(S.String)), modified: S.optional(S.NullOr(S.String)), skipWizard: S.optional(S.NullOr(S.Boolean).pipe(T.Body("skip_wizard"))), status: S.optional(S.NullOr(DisableResponseStatus)), supportSubaddress: S.optional( S.NullOr(S.Boolean).pipe(T.Body("support_subaddress")), ), tag: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DisableEmailRoutingResponse", }) as any as S.Schema; export type EditAddressRequestStatus = "unverified" | "verified"; export const EditAddressRequestStatus = /*@__PURE__*/ S.String; export interface EditAddressRequest { /** Identifier. */ accountId: string; /** Destination address identifier. */ destinationAddressIdentifier: string; /** Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges. */ status: EditAddressRequestStatus | (string & {}); } export const EditAddressRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), destinationAddressIdentifier: S.String.pipe( T.Label("destination_address_identifier"), ), status: EditAddressRequestStatus, }) .pipe( T.Http({ method: "PATCH", uri: "/accounts/{account_id}/email/routing/addresses/{destination_address_identifier}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "EditAddressRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface EditAddressResponse { /** Destination address identifier. */ id?: string | null; /** The date and time the destination address has been created. */ created?: string | null; /** The contact email address of the user. */ email?: string | null; /** The date and time the destination address was last modified. */ modified?: string | null; /** Destination address tag. (Deprecated, replaced by destination address identifier) */ tag?: string | null; /** The date and time the destination address has been verified. Null means not verified yet. */ verified?: string | null; } export const EditAddressResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), created: S.optional(S.NullOr(S.String)), email: S.optional(S.NullOr(S.String)), modified: S.optional(S.NullOr(S.String)), tag: S.optional(S.NullOr(S.String)), verified: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "EditAddressResponse", }) as any as S.Schema; export interface EnableEmailRoutingRequest { /** Identifier. */ zoneId: string; } export const EnableEmailRoutingRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/email/routing/enable", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "EnableEmailRoutingRequest", }) as any as S.Schema; export type EnableResponseStatus = | "ready" | "unconfigured" | "misconfigured" | "misconfigured/locked" | "unlocked"; export const EnableResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface EnableEmailRoutingResponse { /** Email Routing settings identifier. */ id: string; /** State of the zone settings for Email Routing. */ enabled: boolean; /** Domain of your zone. */ name: string; /** The date and time the settings have been created. */ created?: string | null; /** The date and time the settings have been modified. */ modified?: string | null; /** Flag to check if the user skipped the configuration wizard. */ skipWizard?: boolean | null; /** Show the state of your account, and the type or configuration error. */ status?: EnableResponseStatus | null; /** Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules. */ supportSubaddress?: boolean | null; /** Email Routing settings tag. (Deprecated, replaced by Email Routing settings identifier) */ tag?: string | null; } export const EnableEmailRoutingResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, enabled: S.Boolean, name: S.String, created: S.optional(S.NullOr(S.String)), modified: S.optional(S.NullOr(S.String)), skipWizard: S.optional(S.NullOr(S.Boolean).pipe(T.Body("skip_wizard"))), status: S.optional(S.NullOr(EnableResponseStatus)), supportSubaddress: S.optional( S.NullOr(S.Boolean).pipe(T.Body("support_subaddress")), ), tag: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "EnableEmailRoutingResponse", }) as any as S.Schema; export interface GetAddressRequest { /** Identifier. */ accountId: string; /** Destination address identifier. */ destinationAddressIdentifier: string; } export const GetAddressRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), destinationAddressIdentifier: S.String.pipe( T.Label("destination_address_identifier"), ), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/email/routing/addresses/{destination_address_identifier}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetAddressRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetAddressResponse { /** Destination address identifier. */ id?: string | null; /** The date and time the destination address has been created. */ created?: string | null; /** The contact email address of the user. */ email?: string | null; /** The date and time the destination address was last modified. */ modified?: string | null; /** Destination address tag. (Deprecated, replaced by destination address identifier) */ tag?: string | null; /** The date and time the destination address has been verified. Null means not verified yet. */ verified?: string | null; } export const GetAddressResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), created: S.optional(S.NullOr(S.String)), email: S.optional(S.NullOr(S.String)), modified: S.optional(S.NullOr(S.String)), tag: S.optional(S.NullOr(S.String)), verified: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetAddressResponse", }) as any as S.Schema; export interface GetDnsRequest { /** Identifier. */ zoneId: string; /** Domain of your zone. */ subdomain?: string; } export const GetDnsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), subdomain: S.optional(S.String.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/email/routing/dns", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetDnsRequest" }) as any as S.Schema; export type DnsGetResponseErrorsItemMissingType = | "A" | "AAAA" | "CNAME" | "HTTPS" | "TXT" | "SRV" | "LOC" | "MX" | "NS" | "CERT" | "DNSKEY" | "DS" | "NAPTR" | "SMIMEA" | "SSHFP" | "SVCB" | "TLSA" | "URI"; export const DnsGetResponseErrorsItemMissingType = /*@__PURE__*/ S.String; export interface DnsGetResponseErrorsItemMissing { /** DNS record content. */ content?: string | null; /** DNS record name (or @ for the zone apex). */ name?: string | null; /** Required for MX, SRV and URI records. Unused by other record types. Records with lower priorities are preferred. */ priority?: number | null; /** Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. */ ttl?: number | null; /** DNS record type. */ type?: DnsGetResponseErrorsItemMissingType | null; } export const DnsGetResponseErrorsItemMissing = /*@__PURE__*/ S.suspend(() => S.Struct({ content: S.optional(S.NullOr(S.String)), name: S.optional(S.NullOr(S.String)), priority: S.optional(S.NullOr(S.Number)), ttl: S.optional(S.NullOr(S.Number)), type: S.optional(S.NullOr(DnsGetResponseErrorsItemMissingType)), }), ).annotate({ identifier: "DnsGetResponseErrorsItemMissing", }) as any as S.Schema; export interface DnsGetResponseErrorsItem { code?: string | null; /** List of records needed to enable an Email Routing zone. */ missing?: DnsGetResponseErrorsItemMissing | null; } export const DnsGetResponseErrorsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ code: S.optional(S.NullOr(S.String)), missing: S.optional(S.NullOr(DnsGetResponseErrorsItemMissing)), }), ).annotate({ identifier: "DnsGetResponseErrorsItem", }) as any as S.Schema; export type DnsGetResponseErrorsList = Array; export const DnsGetResponseErrorsList = /*@__PURE__*/ S.Array( DnsGetResponseErrorsItem, ) as any as S.Schema; export interface DnsGetResponseRecordItem { /** DNS record content. */ content?: string | null; /** DNS record name (or @ for the zone apex). */ name?: string | null; /** Required for MX, SRV and URI records. Unused by other record types. Records with lower priorities are preferred. */ priority?: number | null; /** Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. */ ttl?: number | null; /** DNS record type. */ type?: string | null; } export const DnsGetResponseRecordItem = /*@__PURE__*/ S.suspend(() => S.Struct({ content: S.optional(S.NullOr(S.String)), name: S.optional(S.NullOr(S.String)), priority: S.optional(S.NullOr(S.Number)), ttl: S.optional(S.NullOr(S.Number)), type: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "DnsGetResponseRecordItem", }) as any as S.Schema; export type DnsGetResponseRecordList = Array; export const DnsGetResponseRecordList = /*@__PURE__*/ S.Array( DnsGetResponseRecordItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetDnsResponse { errors?: DnsGetResponseErrorsList | null; record?: DnsGetResponseRecordList | null; } export const GetDnsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ errors: S.optional(S.NullOr(DnsGetResponseErrorsList)), record: S.optional(S.NullOr(DnsGetResponseRecordList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetDnsResponse" }) as any as S.Schema; export interface GetEmailRoutingRequest { /** Identifier. */ zoneId: string; } export const GetEmailRoutingRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/email/routing", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetEmailRoutingRequest", }) as any as S.Schema; export type GetResponseStatus = | "ready" | "unconfigured" | "misconfigured" | "misconfigured/locked" | "unlocked"; export const GetResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetEmailRoutingResponse { /** Email Routing settings identifier. */ id: string; /** State of the zone settings for Email Routing. */ enabled: boolean; /** Domain of your zone. */ name: string; /** The date and time the settings have been created. */ created?: string | null; /** The date and time the settings have been modified. */ modified?: string | null; /** Flag to check if the user skipped the configuration wizard. */ skipWizard?: boolean | null; /** Show the state of your account, and the type or configuration error. */ status?: GetResponseStatus | null; /** Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules. */ supportSubaddress?: boolean | null; /** Email Routing settings tag. (Deprecated, replaced by Email Routing settings identifier) */ tag?: string | null; } export const GetEmailRoutingResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, enabled: S.Boolean, name: S.String, created: S.optional(S.NullOr(S.String)), modified: S.optional(S.NullOr(S.String)), skipWizard: S.optional(S.NullOr(S.Boolean).pipe(T.Body("skip_wizard"))), status: S.optional(S.NullOr(GetResponseStatus)), supportSubaddress: S.optional( S.NullOr(S.Boolean).pipe(T.Body("support_subaddress")), ), tag: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetEmailRoutingResponse", }) as any as S.Schema; export interface GetRuleRequest { /** Identifier. */ zoneId: string; /** Routing rule identifier. */ ruleIdentifier: string; } export const GetRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), ruleIdentifier: S.String.pipe(T.Label("rule_identifier")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/email/routing/rules/{rule_identifier}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRuleRequest" }) as any as S.Schema; export type RulesGetResponseActionsItemType = "drop" | "forward" | "worker"; export const RulesGetResponseActionsItemType = /*@__PURE__*/ S.String; export type RulesGetResponseActionsItemValueList = Array; export const RulesGetResponseActionsItemValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface RulesGetResponseActionsItem { /** Type of supported action. */ type: RulesGetResponseActionsItemType; value?: RulesGetResponseActionsItemValueList | null; } export const RulesGetResponseActionsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: RulesGetResponseActionsItemType, value: S.optional(S.NullOr(RulesGetResponseActionsItemValueList)), }), ).annotate({ identifier: "RulesGetResponseActionsItem", }) as any as S.Schema; export type RulesGetResponseActionsList = Array; export const RulesGetResponseActionsList = /*@__PURE__*/ S.Array( RulesGetResponseActionsItem, ) as any as S.Schema; export type RulesGetResponseMatchersItemType = "all" | "literal"; export const RulesGetResponseMatchersItemType = /*@__PURE__*/ S.String; export type RulesGetResponseMatchersItemField = "to"; export const RulesGetResponseMatchersItemField = /*@__PURE__*/ S.String; export interface RulesGetResponseMatchersItem { /** Type of matcher. */ type: RulesGetResponseMatchersItemType; /** Field for type matcher. */ field?: RulesGetResponseMatchersItemField | null; /** Value for matcher. */ value?: string | null; } export const RulesGetResponseMatchersItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: RulesGetResponseMatchersItemType, field: S.optional(S.NullOr(RulesGetResponseMatchersItemField)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesGetResponseMatchersItem", }) as any as S.Schema; export type RulesGetResponseMatchersList = Array; export const RulesGetResponseMatchersList = /*@__PURE__*/ S.Array( RulesGetResponseMatchersItem, ) as any as S.Schema; export type RulesGetResponseSource = "api" | "wrangler"; export const RulesGetResponseSource = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetRuleResponse { /** Routing rule identifier. */ id?: string | null; /** List actions patterns. */ actions?: RulesGetResponseActionsList | null; /** Routing rule status. */ enabled?: boolean | null; /** Matching patterns to forward to your actions. */ matchers?: RulesGetResponseMatchersList | null; /** Routing rule name. */ name?: string | null; /** Priority of the routing rule. */ priority?: number | null; /** Who manages the rule. `api` covers dashboard, generic API, and Terraform; */ source?: RulesGetResponseSource | null; /** Routing rule tag. (Deprecated, replaced by routing rule identifier) */ tag?: string | null; } export const GetRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), actions: S.optional(S.NullOr(RulesGetResponseActionsList)), enabled: S.optional(S.NullOr(S.Boolean)), matchers: S.optional(S.NullOr(RulesGetResponseMatchersList)), name: S.optional(S.NullOr(S.String)), priority: S.optional(S.NullOr(S.Number)), source: S.optional(S.NullOr(RulesGetResponseSource)), tag: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRuleResponse", }) as any as S.Schema; export interface GetRuleCatchAllRequest { /** Identifier. */ zoneId: string; } export const GetRuleCatchAllRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/email/routing/rules/catch_all", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRuleCatchAllRequest", }) as any as S.Schema; export type RulesCatchAllsGetResponseActionsItemType = | "drop" | "forward" | "worker"; export const RulesCatchAllsGetResponseActionsItemType = /*@__PURE__*/ S.String; export type RulesCatchAllsGetResponseActionsItemValueList = Array; export const RulesCatchAllsGetResponseActionsItemValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface RulesCatchAllsGetResponseActionsItem { /** Type of action for catch-all rule. */ type: RulesCatchAllsGetResponseActionsItemType; value?: RulesCatchAllsGetResponseActionsItemValueList | null; } export const RulesCatchAllsGetResponseActionsItem = /*@__PURE__*/ S.suspend( () => S.Struct({ type: RulesCatchAllsGetResponseActionsItemType, value: S.optional( S.NullOr(RulesCatchAllsGetResponseActionsItemValueList), ), }), ).annotate({ identifier: "RulesCatchAllsGetResponseActionsItem", }) as any as S.Schema; export type RulesCatchAllsGetResponseActionsList = Array; export const RulesCatchAllsGetResponseActionsList = /*@__PURE__*/ S.Array( RulesCatchAllsGetResponseActionsItem, ) as any as S.Schema; export type RulesCatchAllsGetResponseMatchersItemType = "all"; export const RulesCatchAllsGetResponseMatchersItemType = /*@__PURE__*/ S.String; export interface RulesCatchAllsGetResponseMatchersItem { /** Type of matcher. Default is 'all'. */ type: RulesCatchAllsGetResponseMatchersItemType; } export const RulesCatchAllsGetResponseMatchersItem = /*@__PURE__*/ S.suspend( () => S.Struct({ type: RulesCatchAllsGetResponseMatchersItemType, }), ).annotate({ identifier: "RulesCatchAllsGetResponseMatchersItem", }) as any as S.Schema; export type RulesCatchAllsGetResponseMatchersList = Array; export const RulesCatchAllsGetResponseMatchersList = /*@__PURE__*/ S.Array( RulesCatchAllsGetResponseMatchersItem, ) as any as S.Schema; export type RulesCatchAllsGetResponseSource = "api" | "wrangler"; export const RulesCatchAllsGetResponseSource = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetRuleCatchAllResponse { /** Routing rule identifier. */ id?: string | null; /** List actions for the catch-all routing rule. */ actions?: RulesCatchAllsGetResponseActionsList | null; /** Routing rule status. */ enabled?: boolean | null; /** List of matchers for the catch-all routing rule. */ matchers?: RulesCatchAllsGetResponseMatchersList | null; /** Routing rule name. */ name?: string | null; /** Who manages the rule. `api` covers dashboard, generic API, and Terraform; */ source?: RulesCatchAllsGetResponseSource | null; /** Routing rule tag. (Deprecated, replaced by routing rule identifier) */ tag?: string | null; } export const GetRuleCatchAllResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), actions: S.optional(S.NullOr(RulesCatchAllsGetResponseActionsList)), enabled: S.optional(S.NullOr(S.Boolean)), matchers: S.optional(S.NullOr(RulesCatchAllsGetResponseMatchersList)), name: S.optional(S.NullOr(S.String)), source: S.optional(S.NullOr(RulesCatchAllsGetResponseSource)), tag: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRuleCatchAllResponse", }) as any as S.Schema; export type AddressesListRequestDirection = "asc" | "desc"; export const AddressesListRequestDirection = /*@__PURE__*/ S.String; export interface ListAddressesRequest { /** Identifier. */ accountId: string; /** Sorts results in an ascending or descending order. */ direction?: AddressesListRequestDirection | (string & {}); /** Page number of paginated results. */ page?: number; /** Maximum number of results per page. */ perPage?: number; /** Filter by verified destination addresses. */ verified?: string; } export const ListAddressesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), direction: S.optional(AddressesListRequestDirection.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), verified: S.optional(S.String.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/email/routing/addresses", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListAddressesRequest", }) as any as S.Schema; export interface AddressesListResultItem { /** Destination address identifier. */ id?: string | null; /** The date and time the destination address has been created. */ created?: string | null; /** The contact email address of the user. */ email?: string | null; /** The date and time the destination address was last modified. */ modified?: string | null; /** Destination address tag. (Deprecated, replaced by destination address identifier) */ tag?: string | null; /** The date and time the destination address has been verified. Null means not verified yet. */ verified?: string | null; } export const AddressesListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), created: S.optional(S.NullOr(S.String)), email: S.optional(S.NullOr(S.String)), modified: S.optional(S.NullOr(S.String)), tag: S.optional(S.NullOr(S.String)), verified: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "AddressesListResultItem", }) as any as S.Schema; export type AddressesListResultList = Array; export const AddressesListResultList = /*@__PURE__*/ S.Array( AddressesListResultItem, ) as any as S.Schema; export interface ListAddressesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: AddressesListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListAddressesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: AddressesListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListAddressesResponse", }) as any as S.Schema; export interface ListRulesRequest { /** Identifier. */ zoneId: string; page?: number; perPage?: number; /** Filter by enabled routing rules. */ enabled?: boolean; } export const ListRulesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), enabled: S.optional(S.Boolean.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/email/routing/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListRulesRequest", }) as any as S.Schema; export type ListRulesResponseResultList = Array; export const ListRulesResponseResultList = /*@__PURE__*/ S.Array( GetRuleResponse, ) as any as S.Schema; export interface ListRulesResponse { /** Routing rules for the zone. */ result: ListRulesResponseResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListRulesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: ListRulesResponseResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListRulesResponse", }) as any as S.Schema; export interface PatchDnsRequest { /** Identifier. */ zoneId: string; /** Domain of your zone. */ name?: string; } export const PatchDnsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), name: S.optional(S.String), }) .pipe( T.Http({ method: "PATCH", uri: "/zones/{zone_id}/email/routing/dns", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchDnsRequest", }) as any as S.Schema; export type DnsEditResponseStatus = | "ready" | "unconfigured" | "misconfigured" | "misconfigured/locked" | "unlocked"; export const DnsEditResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchDnsResponse { /** Email Routing settings identifier. */ id: string; /** State of the zone settings for Email Routing. */ enabled: boolean; /** Domain of your zone. */ name: string; /** The date and time the settings have been created. */ created?: string | null; /** The date and time the settings have been modified. */ modified?: string | null; /** Flag to check if the user skipped the configuration wizard. */ skipWizard?: boolean | null; /** Show the state of your account, and the type or configuration error. */ status?: DnsEditResponseStatus | null; /** Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules. */ supportSubaddress?: boolean | null; /** Email Routing settings tag. (Deprecated, replaced by Email Routing settings identifier) */ tag?: string | null; } export const PatchDnsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, enabled: S.Boolean, name: S.String, created: S.optional(S.NullOr(S.String)), modified: S.optional(S.NullOr(S.String)), skipWizard: S.optional(S.NullOr(S.Boolean).pipe(T.Body("skip_wizard"))), status: S.optional(S.NullOr(DnsEditResponseStatus)), supportSubaddress: S.optional( S.NullOr(S.Boolean).pipe(T.Body("support_subaddress")), ), tag: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchDnsResponse", }) as any as S.Schema; export type RulesCatchAllsUpdateRequestActionsItemType = | "drop" | "forward" | "worker"; export const RulesCatchAllsUpdateRequestActionsItemType = /*@__PURE__*/ S.String; export type RulesCatchAllsUpdateRequestActionsItemValueList = Array; export const RulesCatchAllsUpdateRequestActionsItemValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface RulesCatchAllsUpdateRequestActionsItem { /** Type of action for catch-all rule. */ type: RulesCatchAllsUpdateRequestActionsItemType | (string & {}); value?: RulesCatchAllsUpdateRequestActionsItemValueList; } export const RulesCatchAllsUpdateRequestActionsItem = /*@__PURE__*/ S.suspend( () => S.Struct({ type: RulesCatchAllsUpdateRequestActionsItemType, value: S.optional(RulesCatchAllsUpdateRequestActionsItemValueList), }), ).annotate({ identifier: "RulesCatchAllsUpdateRequestActionsItem", }) as any as S.Schema; export type RulesCatchAllsUpdateRequestActionsList = Array; export const RulesCatchAllsUpdateRequestActionsList = /*@__PURE__*/ S.Array( RulesCatchAllsUpdateRequestActionsItem, ) as any as S.Schema; export type RulesCatchAllsUpdateRequestMatchersItemType = "all"; export const RulesCatchAllsUpdateRequestMatchersItemType = /*@__PURE__*/ S.String; export interface RulesCatchAllsUpdateRequestMatchersItem { /** Type of matcher. Default is 'all'. */ type: RulesCatchAllsUpdateRequestMatchersItemType | (string & {}); } export const RulesCatchAllsUpdateRequestMatchersItem = /*@__PURE__*/ S.suspend( () => S.Struct({ type: RulesCatchAllsUpdateRequestMatchersItemType, }), ).annotate({ identifier: "RulesCatchAllsUpdateRequestMatchersItem", }) as any as S.Schema; export type RulesCatchAllsUpdateRequestMatchersList = Array; export const RulesCatchAllsUpdateRequestMatchersList = /*@__PURE__*/ S.Array( RulesCatchAllsUpdateRequestMatchersItem, ) as any as S.Schema; export type RulesCatchAllsUpdateRequestSource = "api" | "wrangler"; export const RulesCatchAllsUpdateRequestSource = /*@__PURE__*/ S.String; export interface PutRuleCatchAllRequest { /** Identifier. */ zoneId: string; /** List actions for the catch-all routing rule. */ actions: RulesCatchAllsUpdateRequestActionsList; /** List of matchers for the catch-all routing rule. */ matchers: RulesCatchAllsUpdateRequestMatchersList; /** Routing rule status. */ enabled?: boolean; /** Routing rule name. */ name?: string; /** Public tag (script_tag) of the Worker that owns this rule. Required when */ ownerWorkerTag?: string; /** Who manages the rule. `api` covers dashboard, generic API, and Terraform; */ source?: RulesCatchAllsUpdateRequestSource | (string & {}); } export const PutRuleCatchAllRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), actions: RulesCatchAllsUpdateRequestActionsList, matchers: RulesCatchAllsUpdateRequestMatchersList, enabled: S.optional(S.Boolean), name: S.optional(S.String), ownerWorkerTag: S.optional(S.String.pipe(T.Body("owner_worker_tag"))), source: S.optional(RulesCatchAllsUpdateRequestSource), }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/email/routing/rules/catch_all", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PutRuleCatchAllRequest", }) as any as S.Schema; export type RulesCatchAllsUpdateResponseActionsItemType = | "drop" | "forward" | "worker"; export const RulesCatchAllsUpdateResponseActionsItemType = /*@__PURE__*/ S.String; export type RulesCatchAllsUpdateResponseActionsItemValueList = Array; export const RulesCatchAllsUpdateResponseActionsItemValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface RulesCatchAllsUpdateResponseActionsItem { /** Type of action for catch-all rule. */ type: RulesCatchAllsUpdateResponseActionsItemType; value?: RulesCatchAllsUpdateResponseActionsItemValueList | null; } export const RulesCatchAllsUpdateResponseActionsItem = /*@__PURE__*/ S.suspend( () => S.Struct({ type: RulesCatchAllsUpdateResponseActionsItemType, value: S.optional( S.NullOr(RulesCatchAllsUpdateResponseActionsItemValueList), ), }), ).annotate({ identifier: "RulesCatchAllsUpdateResponseActionsItem", }) as any as S.Schema; export type RulesCatchAllsUpdateResponseActionsList = Array; export const RulesCatchAllsUpdateResponseActionsList = /*@__PURE__*/ S.Array( RulesCatchAllsUpdateResponseActionsItem, ) as any as S.Schema; export type RulesCatchAllsUpdateResponseMatchersItemType = "all"; export const RulesCatchAllsUpdateResponseMatchersItemType = /*@__PURE__*/ S.String; export interface RulesCatchAllsUpdateResponseMatchersItem { /** Type of matcher. Default is 'all'. */ type: RulesCatchAllsUpdateResponseMatchersItemType; } export const RulesCatchAllsUpdateResponseMatchersItem = /*@__PURE__*/ S.suspend( () => S.Struct({ type: RulesCatchAllsUpdateResponseMatchersItemType, }), ).annotate({ identifier: "RulesCatchAllsUpdateResponseMatchersItem", }) as any as S.Schema; export type RulesCatchAllsUpdateResponseMatchersList = Array; export const RulesCatchAllsUpdateResponseMatchersList = /*@__PURE__*/ S.Array( RulesCatchAllsUpdateResponseMatchersItem, ) as any as S.Schema; export type RulesCatchAllsUpdateResponseSource = "api" | "wrangler"; export const RulesCatchAllsUpdateResponseSource = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PutRuleCatchAllResponse { /** Routing rule identifier. */ id?: string | null; /** List actions for the catch-all routing rule. */ actions?: RulesCatchAllsUpdateResponseActionsList | null; /** Routing rule status. */ enabled?: boolean | null; /** List of matchers for the catch-all routing rule. */ matchers?: RulesCatchAllsUpdateResponseMatchersList | null; /** Routing rule name. */ name?: string | null; /** Who manages the rule. `api` covers dashboard, generic API, and Terraform; */ source?: RulesCatchAllsUpdateResponseSource | null; /** Routing rule tag. (Deprecated, replaced by routing rule identifier) */ tag?: string | null; } export const PutRuleCatchAllResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), actions: S.optional(S.NullOr(RulesCatchAllsUpdateResponseActionsList)), enabled: S.optional(S.NullOr(S.Boolean)), matchers: S.optional(S.NullOr(RulesCatchAllsUpdateResponseMatchersList)), name: S.optional(S.NullOr(S.String)), source: S.optional(S.NullOr(RulesCatchAllsUpdateResponseSource)), tag: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PutRuleCatchAllResponse", }) as any as S.Schema; export interface UnlockRequest { /** Identifier. */ zoneId: string; /** Domain of your zone. */ name?: string; } export const UnlockRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), name: S.optional(S.String), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/email/routing/unlock", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UnlockRequest" }) as any as S.Schema; export type UnlockResponseStatus = | "ready" | "unconfigured" | "misconfigured" | "misconfigured/locked" | "unlocked"; export const UnlockResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UnlockResponse { /** Email Routing settings identifier. */ id: string; /** State of the zone settings for Email Routing. */ enabled: boolean; /** Domain of your zone. */ name: string; /** The date and time the settings have been created. */ created?: string | null; /** The date and time the settings have been modified. */ modified?: string | null; /** Flag to check if the user skipped the configuration wizard. */ skipWizard?: boolean | null; /** Show the state of your account, and the type or configuration error. */ status?: UnlockResponseStatus | null; /** Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules. */ supportSubaddress?: boolean | null; /** Email Routing settings tag. (Deprecated, replaced by Email Routing settings identifier) */ tag?: string | null; } export const UnlockResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, enabled: S.Boolean, name: S.String, created: S.optional(S.NullOr(S.String)), modified: S.optional(S.NullOr(S.String)), skipWizard: S.optional(S.NullOr(S.Boolean).pipe(T.Body("skip_wizard"))), status: S.optional(S.NullOr(UnlockResponseStatus)), supportSubaddress: S.optional( S.NullOr(S.Boolean).pipe(T.Body("support_subaddress")), ), tag: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UnlockResponse" }) as any as S.Schema; export type RulesUpdateRequestActionsItemType = "drop" | "forward" | "worker"; export const RulesUpdateRequestActionsItemType = /*@__PURE__*/ S.String; export type RulesUpdateRequestActionsItemValueList = Array; export const RulesUpdateRequestActionsItemValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface RulesUpdateRequestActionsItem { /** Type of supported action. */ type: RulesUpdateRequestActionsItemType | (string & {}); value?: RulesUpdateRequestActionsItemValueList; } export const RulesUpdateRequestActionsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: RulesUpdateRequestActionsItemType, value: S.optional(RulesUpdateRequestActionsItemValueList), }), ).annotate({ identifier: "RulesUpdateRequestActionsItem", }) as any as S.Schema; export type RulesUpdateRequestActionsList = Array; export const RulesUpdateRequestActionsList = /*@__PURE__*/ S.Array( RulesUpdateRequestActionsItem, ) as any as S.Schema; export type RulesUpdateRequestMatchersItemType = "all" | "literal"; export const RulesUpdateRequestMatchersItemType = /*@__PURE__*/ S.String; export type RulesUpdateRequestMatchersItemField = "to"; export const RulesUpdateRequestMatchersItemField = /*@__PURE__*/ S.String; export interface RulesUpdateRequestMatchersItem { /** Type of matcher. */ type: RulesUpdateRequestMatchersItemType | (string & {}); /** Field for type matcher. */ field?: RulesUpdateRequestMatchersItemField | (string & {}); /** Value for matcher. */ value?: string; } export const RulesUpdateRequestMatchersItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: RulesUpdateRequestMatchersItemType, field: S.optional(RulesUpdateRequestMatchersItemField), value: S.optional(S.String), }), ).annotate({ identifier: "RulesUpdateRequestMatchersItem", }) as any as S.Schema; export type RulesUpdateRequestMatchersList = Array; export const RulesUpdateRequestMatchersList = /*@__PURE__*/ S.Array( RulesUpdateRequestMatchersItem, ) as any as S.Schema; export type RulesUpdateRequestSource = "api" | "wrangler"; export const RulesUpdateRequestSource = /*@__PURE__*/ S.String; export interface UpdateRuleRequest { /** Identifier. */ zoneId: string; /** Routing rule identifier. */ ruleIdentifier: string; /** List actions patterns. */ actions: RulesUpdateRequestActionsList; /** Matching patterns to forward to your actions. */ matchers: RulesUpdateRequestMatchersList; /** Routing rule status. */ enabled?: boolean; /** Routing rule name. */ name?: string; /** Public tag (script_tag) of the Worker that owns this rule. Required when */ ownerWorkerTag?: string; /** Priority of the routing rule. */ priority?: number; /** Who manages the rule. `api` covers dashboard, generic API, and Terraform; */ source?: RulesUpdateRequestSource | (string & {}); } export const UpdateRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), ruleIdentifier: S.String.pipe(T.Label("rule_identifier")), actions: RulesUpdateRequestActionsList, matchers: RulesUpdateRequestMatchersList, enabled: S.optional(S.Boolean), name: S.optional(S.String), ownerWorkerTag: S.optional(S.String.pipe(T.Body("owner_worker_tag"))), priority: S.optional(S.Number), source: S.optional(RulesUpdateRequestSource), }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/email/routing/rules/{rule_identifier}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateRuleRequest", }) as any as S.Schema; export type RulesUpdateResponseActionsItemType = "drop" | "forward" | "worker"; export const RulesUpdateResponseActionsItemType = /*@__PURE__*/ S.String; export type RulesUpdateResponseActionsItemValueList = Array; export const RulesUpdateResponseActionsItemValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface RulesUpdateResponseActionsItem { /** Type of supported action. */ type: RulesUpdateResponseActionsItemType; value?: RulesUpdateResponseActionsItemValueList | null; } export const RulesUpdateResponseActionsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: RulesUpdateResponseActionsItemType, value: S.optional(S.NullOr(RulesUpdateResponseActionsItemValueList)), }), ).annotate({ identifier: "RulesUpdateResponseActionsItem", }) as any as S.Schema; export type RulesUpdateResponseActionsList = Array; export const RulesUpdateResponseActionsList = /*@__PURE__*/ S.Array( RulesUpdateResponseActionsItem, ) as any as S.Schema; export type RulesUpdateResponseMatchersItemType = "all" | "literal"; export const RulesUpdateResponseMatchersItemType = /*@__PURE__*/ S.String; export type RulesUpdateResponseMatchersItemField = "to"; export const RulesUpdateResponseMatchersItemField = /*@__PURE__*/ S.String; export interface RulesUpdateResponseMatchersItem { /** Type of matcher. */ type: RulesUpdateResponseMatchersItemType; /** Field for type matcher. */ field?: RulesUpdateResponseMatchersItemField | null; /** Value for matcher. */ value?: string | null; } export const RulesUpdateResponseMatchersItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: RulesUpdateResponseMatchersItemType, field: S.optional(S.NullOr(RulesUpdateResponseMatchersItemField)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesUpdateResponseMatchersItem", }) as any as S.Schema; export type RulesUpdateResponseMatchersList = Array; export const RulesUpdateResponseMatchersList = /*@__PURE__*/ S.Array( RulesUpdateResponseMatchersItem, ) as any as S.Schema; export type RulesUpdateResponseSource = "api" | "wrangler"; export const RulesUpdateResponseSource = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateRuleResponse { /** Routing rule identifier. */ id?: string | null; /** List actions patterns. */ actions?: RulesUpdateResponseActionsList | null; /** Routing rule status. */ enabled?: boolean | null; /** Matching patterns to forward to your actions. */ matchers?: RulesUpdateResponseMatchersList | null; /** Routing rule name. */ name?: string | null; /** Priority of the routing rule. */ priority?: number | null; /** Who manages the rule. `api` covers dashboard, generic API, and Terraform; */ source?: RulesUpdateResponseSource | null; /** Routing rule tag. (Deprecated, replaced by routing rule identifier) */ tag?: string | null; } export const UpdateRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), actions: S.optional(S.NullOr(RulesUpdateResponseActionsList)), enabled: S.optional(S.NullOr(S.Boolean)), matchers: S.optional(S.NullOr(RulesUpdateResponseMatchersList)), name: S.optional(S.NullOr(S.String)), priority: S.optional(S.NullOr(S.Number)), source: S.optional(S.NullOr(RulesUpdateResponseSource)), tag: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateRuleResponse", }) as any as S.Schema; export type CreateAddressError = CloudflareOpError; /** Create a destination address to forward your emails to. Destination addresses need to be verified before they can be used. */ export const createAddress: API.OperationMethod< CreateAddressRequest, CreateAddressResponse, CreateAddressError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateAddressRequest, output: CreateAddressResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateDnsError = CloudflareOpError; /** Enable you Email Routing zone. Add and lock the necessary MX and SPF records. */ export const createDns: API.OperationMethod< CreateDnsRequest, CreateDnsResponse, CreateDnsError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateDnsRequest, output: CreateDnsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateRuleError = WorkerScriptNotFound | CloudflareOpError; /** 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. */ export const createRule: API.OperationMethod< CreateRuleRequest, CreateRuleResponse, CreateRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateRuleRequest, output: CreateRuleResponse, errors: [WorkerScriptNotFound, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteAddressError = | EmailAddressNotFound | EmailAddressCreatedTooRecently | CloudflareOpError; /** Deletes a specific destination address. */ export const deleteAddress: API.OperationMethod< DeleteAddressRequest, DeleteAddressResponse, DeleteAddressError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteAddressRequest, output: DeleteAddressResponse, errors: [ EmailAddressNotFound, EmailAddressCreatedTooRecently, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteDnsError = CloudflareOpError; /** Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work. */ export const deleteDns: API.OperationMethod< DeleteDnsRequest, DeleteDnsResponse, DeleteDnsError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteDnsRequest, output: DeleteDnsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteRuleError = EmailRoutingRuleNotFound | CloudflareOpError; /** Delete a specific routing rule. */ export const deleteRule: API.OperationMethod< DeleteRuleRequest, DeleteRuleResponse, DeleteRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteRuleRequest, output: DeleteRuleResponse, errors: [EmailRoutingRuleNotFound, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DisableEmailRoutingError = Forbidden | CloudflareOpError; /** Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work. */ export const disableEmailRouting: API.OperationMethod< DisableEmailRoutingRequest, DisableEmailRoutingResponse, DisableEmailRoutingError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DisableEmailRoutingRequest, output: DisableEmailRoutingResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type EditAddressError = CloudflareOpError; /** Updates the status of a specific destination address. */ export const editAddress: API.OperationMethod< EditAddressRequest, EditAddressResponse, EditAddressError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: EditAddressRequest, output: EditAddressResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type EnableEmailRoutingError = Forbidden | CloudflareOpError; /** Enable you Email Routing zone. Add and lock the necessary MX and SPF records. */ export const enableEmailRouting: API.OperationMethod< EnableEmailRoutingRequest, EnableEmailRoutingResponse, EnableEmailRoutingError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: EnableEmailRoutingRequest, output: EnableEmailRoutingResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetAddressError = CloudflareOpError; /** Gets information for a specific destination email already created. */ export const getAddress: API.OperationMethod< GetAddressRequest, GetAddressResponse, GetAddressError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetAddressRequest, output: GetAddressResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetDnsError = CloudflareOpError; /** Show the DNS records needed to configure your Email Routing zone. */ export const getDns: API.OperationMethod< GetDnsRequest, GetDnsResponse, GetDnsError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetDnsRequest, output: GetDnsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetEmailRoutingError = Forbidden | CloudflareOpError; /** Get information about the settings for your Email Routing zone. */ export const getEmailRouting: API.OperationMethod< GetEmailRoutingRequest, GetEmailRoutingResponse, GetEmailRoutingError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetEmailRoutingRequest, output: GetEmailRoutingResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetRuleError = | Forbidden | EmailRoutingRuleNotFound | CloudflareOpError; /** Get information for a specific routing rule already created. */ export const getRule: API.OperationMethod< GetRuleRequest, GetRuleResponse, GetRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetRuleRequest, output: GetRuleResponse, errors: [ Forbidden, EmailRoutingRuleNotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetRuleCatchAllError = Forbidden | CloudflareOpError; /** Get information on the default catch-all routing rule. */ export const getRuleCatchAll: API.OperationMethod< GetRuleCatchAllRequest, GetRuleCatchAllResponse, GetRuleCatchAllError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetRuleCatchAllRequest, output: GetRuleCatchAllResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListAddressesError = CloudflareOpError; /** Lists existing destination addresses. */ export const listAddresses: API.PaginatedOperationMethod< ListAddressesRequest, ListAddressesResponse, ListAddressesError, CloudflareOpContext, AddressesListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListAddressesRequest, output: ListAddressesResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListRulesError = CloudflareOpError; /** List routing rules (docs-absent endpoint). */ export const listRules: API.PaginatedOperationMethod< ListRulesRequest, ListRulesResponse, ListRulesError, CloudflareOpContext, GetRuleResponse > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListRulesRequest, output: ListRulesResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type PatchDnsError = CloudflareOpError; /** Unlock MX Records previously locked by Email Routing. */ export const patchDns: API.OperationMethod< PatchDnsRequest, PatchDnsResponse, PatchDnsError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchDnsRequest, output: PatchDnsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PutRuleCatchAllError = | Forbidden | DestinationNotVerified | WorkerScriptNotFound | CloudflareOpError; /** Enable or disable catch-all routing rule, or change action to forward to specific destination address. Forward actions require all destination addresses to be verified. */ export const putRuleCatchAll: API.OperationMethod< PutRuleCatchAllRequest, PutRuleCatchAllResponse, PutRuleCatchAllError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PutRuleCatchAllRequest, output: PutRuleCatchAllResponse, errors: [ Forbidden, DestinationNotVerified, WorkerScriptNotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UnlockError = CloudflareOpError; /** Unlock MX records previously locked by Email Routing. Deprecated - use PATCH /zones/{zone_id}/email/routing/dns instead. */ export const unlock: API.OperationMethod< UnlockRequest, UnlockResponse, UnlockError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UnlockRequest, output: UnlockResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateRuleError = WorkerScriptNotFound | CloudflareOpError; /** Update actions and matches, or enable/disable specific routing rules. Forward actions require all destination addresses to be verified. */ export const updateRule: API.OperationMethod< UpdateRuleRequest, UpdateRuleResponse, UpdateRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateRuleRequest, output: UpdateRuleResponse, errors: [WorkerScriptNotFound, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, }));