UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

69 lines • 2.83 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Move = exports.BaseMove = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../../core/resource.js"); const pagination_1 = require("../../../core/pagination.js"); const path_1 = require("../../../internal/utils/path.js"); var BaseMove = /* @__PURE__ */ (() => { class BaseMove extends resource_1.APIResource { /** * Moves a single message to a specified mailbox folder (Inbox, JunkEmail, * DeletedItems, RecoverableItemsDeletions, or RecoverableItemsPurges). Requires * active integration. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const moveCreateResponse of client.emailSecurity.investigate.move.create( * '4Njp3P0STMz2c02Q-2024-01-05T10:00:00-12345678', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * destination: 'Inbox', * }, * )) { * // ... * } * ``` */ create(investigateID, params, options) { const { account_id, ...body } = params; return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/email-security/investigate/${investigateID}/move`, (pagination_1.SinglePage), { body, method: 'post', ...options }); } /** * Moves one or more messages to a specified mailbox folder (Inbox, JunkEmail, * DeletedItems, RecoverableItemsDeletions, or RecoverableItemsPurges). Requires * active integration. Operates on an explicit list of messages; to move all * messages matching a search, create a bulk action job instead. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const moveBulkResponse of client.emailSecurity.investigate.move.bulk( * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * destination: 'Inbox', * ids: ['4Njp3P0STMz2c02Q-2024-01-05T10:00:00-12345678'], * }, * )) { * // ... * } * ``` */ bulk(params, options) { const { account_id, ...body } = params; return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/email-security/investigate/move`, (pagination_1.SinglePage), { body, method: 'post', ...options }); } } BaseMove._key = Object.freeze([ 'emailSecurity', 'investigate', 'move', ]); return BaseMove; })(); exports.BaseMove = BaseMove; class Move extends BaseMove { } exports.Move = Move; //# sourceMappingURL=move.js.map