cloudflare
Version:
The official TypeScript library for the Cloudflare API
68 lines • 2.86 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FindingTypes = exports.BaseFindingTypes = void 0;
const tslib_1 = require("../../../../../internal/tslib.js");
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../../../core/resource.js");
const RemediationTypesAPI = tslib_1.__importStar(require("./remediation-types.js"));
const remediation_types_1 = require("./remediation-types.js");
const pagination_1 = require("../../../../../core/pagination.js");
const path_1 = require("../../../../../internal/utils/path.js");
var BaseFindingTypes = /* @__PURE__ */ (() => {
class BaseFindingTypes extends resource_1.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((0, path_1.path) `/accounts/${account_id}/data-security/posture/finding_types`, (pagination_1.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((0, path_1.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;
})();
exports.BaseFindingTypes = BaseFindingTypes;
var FindingTypes = /* @__PURE__ */ (() => {
class FindingTypes extends BaseFindingTypes {
constructor() {
super(...arguments);
this.remediationTypes = new RemediationTypesAPI.RemediationTypes(this._client);
}
}
FindingTypes.RemediationTypes = remediation_types_1.RemediationTypes;
FindingTypes.BaseRemediationTypes = remediation_types_1.BaseRemediationTypes;
return FindingTypes;
})();
exports.FindingTypes = FindingTypes;
//# sourceMappingURL=finding-types.js.map