UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

41 lines 1.39 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../resource.mjs"; export class Preview extends APIResource { /** * Preview for non-detection messages * * @example * ```ts * const preview = * await client.emailSecurity.investigate.preview.create({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * postfix_id: '4Njp3P0STMz2c02Q', * }); * ``` */ create(params, options) { const { account_id, ...body } = params; return this._client.post(`/accounts/${account_id}/email-security/investigate/preview`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Returns a preview of the message body as a base64 encoded PNG image for * non-benign messages. * * @example * ```ts * const preview = * await client.emailSecurity.investigate.preview.get( * '4Njp3P0STMz2c02Q', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ get(postfixId, params, options) { const { account_id } = params; return this._client.get(`/accounts/${account_id}/email-security/investigate/${postfixId}/preview`, options)._thenUnwrap((obj) => obj.result); } } //# sourceMappingURL=preview.mjs.map