UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

58 lines • 2.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CatchAlls = exports.BaseCatchAlls = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../../core/resource.js"); const path_1 = require("../../../internal/utils/path.js"); var BaseCatchAlls = /* @__PURE__ */ (() => { class BaseCatchAlls extends resource_1.APIResource { /** * Enable or disable catch-all routing rule, or change action to forward to a * specific destination address. Forward actions require exactly one verified * destination address. * * @example * ```ts * const catchAll = * await client.emailRouting.rules.catchAlls.update({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * actions: [{ type: 'forward' }], * matchers: [{ type: 'all' }], * }); * ``` */ update(params, options) { const { zone_id, ...body } = params; return this._client.put((0, path_1.path) `/zones/${zone_id}/email/routing/rules/catch_all`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Get information on the default catch-all routing rule. * * @example * ```ts * const catchAll = * await client.emailRouting.rules.catchAlls.get({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ get(params, options) { const { zone_id } = params; return this._client.get((0, path_1.path) `/zones/${zone_id}/email/routing/rules/catch_all`, options)._thenUnwrap((obj) => obj.result); } } BaseCatchAlls._key = Object.freeze([ 'emailRouting', 'rules', 'catchAlls', ]); return BaseCatchAlls; })(); exports.BaseCatchAlls = BaseCatchAlls; class CatchAlls extends BaseCatchAlls { } exports.CatchAlls = CatchAlls; //# sourceMappingURL=catch-alls.js.map