cloudflare
Version:
The official TypeScript library for the Cloudflare API
35 lines • 1.55 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
import * as ProfilesAPI from 'cloudflare/resources/zero-trust/dlp/profiles/profiles';
import * as CustomAPI from 'cloudflare/resources/zero-trust/dlp/profiles/custom';
import * as PredefinedAPI from 'cloudflare/resources/zero-trust/dlp/profiles/predefined';
import { SinglePage } from 'cloudflare/pagination';
export class Profiles extends APIResource {
constructor() {
super(...arguments);
this.custom = new CustomAPI.Custom(this._client);
this.predefined = new PredefinedAPI.Predefined(this._client);
}
/**
* Lists all DLP profiles in an account.
*/
list(params, options) {
const { account_id } = params;
return this._client.getAPIList(`/accounts/${account_id}/dlp/profiles`, DLPProfilesSinglePage, options);
}
/**
* Fetches a DLP profile by ID. Supports both predefined and custom profiles
*/
get(profileId, params, options) {
const { account_id } = params;
return this._client.get(`/accounts/${account_id}/dlp/profiles/${profileId}`, options)._thenUnwrap((obj) => obj.result);
}
}
export class DLPProfilesSinglePage extends SinglePage {
}
(function (Profiles) {
Profiles.DLPProfilesSinglePage = ProfilesAPI.DLPProfilesSinglePage;
Profiles.Custom = CustomAPI.Custom;
Profiles.Predefined = PredefinedAPI.Predefined;
})(Profiles || (Profiles = {}));
//# sourceMappingURL=profiles.mjs.map