UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

62 lines • 2.51 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../../../core/resource.mjs"; import * as RemediationTypesAPI from "./remediation-types.mjs"; import { BaseRemediationTypes, RemediationTypes, } from "./remediation-types.mjs"; import { V4PagePaginationArray, } from "../../../../../core/pagination.mjs"; import { path } from "../../../../../internal/utils/path.mjs"; export var BaseFindingTypes = /* @__PURE__ */ (() => { class BaseFindingTypes extends APIResource { /** * List all available finding types with pagination support. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const findingTypeListResponse of client.zeroTrust.casb.posture.findingTypes.list( * { account_id: '46148281d8a93d002ef242d8b0d5f9f6' }, * )) { * // ... * } * ``` */ list(params, options) { const { account_id, ...query } = params; return this._client.getAPIList(path `/accounts/${account_id}/data-security/posture/finding_types`, (V4PagePaginationArray), { query, ...options }); } /** * Retrieve a specific finding type by its unique identifier. * * @example * ```ts * const findingType = * await client.zeroTrust.casb.posture.findingTypes.get( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: '46148281d8a93d002ef242d8b0d5f9f6' }, * ); * ``` */ get(findingTypeID, params, options) { const { account_id } = params; return this._client.get(path `/accounts/${account_id}/data-security/posture/finding_types/${findingTypeID}`, options)._thenUnwrap((obj) => obj.result); } } BaseFindingTypes._key = Object.freeze([ 'zeroTrust', 'casb', 'posture', 'findingTypes', ]); return BaseFindingTypes; })(); export var FindingTypes = /* @__PURE__ */ (() => { class FindingTypes extends BaseFindingTypes { constructor() { super(...arguments); this.remediationTypes = new RemediationTypesAPI.RemediationTypes(this._client); } } FindingTypes.RemediationTypes = RemediationTypes; FindingTypes.BaseRemediationTypes = BaseRemediationTypes; return FindingTypes; })(); //# sourceMappingURL=finding-types.mjs.map