UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

67 lines • 2.44 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../../core/resource.mjs"; import { V4PagePaginationArray, } from "../../../../core/pagination.mjs"; import { path } from "../../../../internal/utils/path.mjs"; export var BaseContent = /* @__PURE__ */ (() => { class BaseContent extends APIResource { /** * List DLP content findings * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const contentListResponse of client.zeroTrust.casb.posture.content.list( * { account_id: '46148281d8a93d002ef242d8b0d5f9f6' }, * )) { * // ... * } * ``` */ list(params, options) { const { account_id, ...query } = params; return this._client.getAPIList(path `/accounts/${account_id}/data-security/posture/content`, (V4PagePaginationArray), { query, ...options }); } /** * Creates a CSV export for content and accepts optional filters in the payload. * * @example * ```ts * const response = * await client.zeroTrust.casb.posture.content.export({ * account_id: '46148281d8a93d002ef242d8b0d5f9f6', * dlp_profile_information: [ * { * id: 'e91a2360-da51-4fdf-9711-bcdecd462614', * entries: [ * { * id: '55ba2c6c-8ef4-4b2e-9148-e75e8b6ccac1', * name: 'Credit Card Numbers', * profile_id: * 'e91a2360-da51-4fdf-9711-bcdecd462614', * }, * ], * name: 'Financial Information', * }, * ], * }); * ``` */ export(params, options) { const { account_id, ...body } = params; return this._client.post(path `/accounts/${account_id}/data-security/posture/content/export`, { body, ...options, })._thenUnwrap((obj) => obj.result); } } BaseContent._key = Object.freeze([ 'zeroTrust', 'casb', 'posture', 'content', ]); return BaseContent; })(); export class Content extends BaseContent { } //# sourceMappingURL=content.mjs.map