33import { APIResource } from '../../../../resource' ;
44import * as Core from '../../../../core' ;
55import * as CustomAPI from './custom' ;
6- import * as ProfilesAPI from './profiles' ;
76
87export class Predefined extends APIResource {
98 /**
10- * Creates a DLP predefined profile. Only supports enabling/disabling entries.
9+ * This is similar to `update_predefined` but only returns entries that are
10+ * enabled. This is needed for our terraform API Updates a DLP predefined profile.
11+ * Only supports enabling/disabling entries.
1112 *
1213 * @example
1314 * ```ts
14- * const profile =
15- * await client.zeroTrust.dlp.profiles.predefined.create({
16- * account_id: 'account_id',
17- * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
18- * });
19- * ```
20- */
21- create (
22- params : PredefinedCreateParams ,
23- options ?: Core . RequestOptions ,
24- ) : Core . APIPromise < ProfilesAPI . Profile > {
25- const { account_id, ...body } = params ;
26- return (
27- this . _client . post ( `/accounts/${ account_id } /dlp/profiles/predefined` , {
28- body,
29- ...options ,
30- } ) as Core . APIPromise < { result : ProfilesAPI . Profile } >
31- ) . _thenUnwrap ( ( obj ) => obj . result ) ;
32- }
33-
34- /**
35- * Updates a DLP predefined profile. Only supports enabling/disabling entries.
36- *
37- * @example
38- * ```ts
39- * const profile =
15+ * const predefinedProfile =
4016 * await client.zeroTrust.dlp.profiles.predefined.update(
4117 * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
4218 * { account_id: 'account_id' },
@@ -47,13 +23,13 @@ export class Predefined extends APIResource {
4723 profileId : string ,
4824 params : PredefinedUpdateParams ,
4925 options ?: Core . RequestOptions ,
50- ) : Core . APIPromise < ProfilesAPI . Profile > {
26+ ) : Core . APIPromise < PredefinedProfile > {
5127 const { account_id, ...body } = params ;
5228 return (
53- this . _client . put ( `/accounts/${ account_id } /dlp/profiles/predefined/${ profileId } ` , {
29+ this . _client . put ( `/accounts/${ account_id } /dlp/profiles/predefined/${ profileId } /config ` , {
5430 body,
5531 ...options ,
56- } ) as Core . APIPromise < { result : ProfilesAPI . Profile } >
32+ } ) as Core . APIPromise < { result : PredefinedProfile } >
5733 ) . _thenUnwrap ( ( obj ) => obj . result ) ;
5834 }
5935
@@ -85,11 +61,12 @@ export class Predefined extends APIResource {
8561 }
8662
8763 /**
88- * Fetches a predefined DLP profile by id.
64+ * This is similar to `get_predefined` but only returns entries that are enabled.
65+ * This is needed for our terraform API Fetches a predefined DLP profile by id.
8966 *
9067 * @example
9168 * ```ts
92- * const profile =
69+ * const predefinedProfile =
9370 * await client.zeroTrust.dlp.profiles.predefined.get(
9471 * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
9572 * { account_id: 'account_id' },
@@ -100,13 +77,13 @@ export class Predefined extends APIResource {
10077 profileId : string ,
10178 params : PredefinedGetParams ,
10279 options ?: Core . RequestOptions ,
103- ) : Core . APIPromise < ProfilesAPI . Profile > {
80+ ) : Core . APIPromise < PredefinedProfile > {
10481 const { account_id } = params ;
10582 return (
10683 this . _client . get (
107- `/accounts/${ account_id } /dlp/profiles/predefined/${ profileId } ` ,
84+ `/accounts/${ account_id } /dlp/profiles/predefined/${ profileId } /config ` ,
10885 options ,
109- ) as Core . APIPromise < { result : ProfilesAPI . Profile } >
86+ ) as Core . APIPromise < { result : PredefinedProfile } >
11087 ) . _thenUnwrap ( ( obj ) => obj . result ) ;
11188 }
11289}
@@ -119,6 +96,13 @@ export interface PredefinedProfile {
11996
12097 allowed_match_count : number ;
12198
99+ confidence_threshold : string | null ;
100+
101+ enabled_entries : Array < string > ;
102+
103+ /**
104+ * @deprecated
105+ */
122106 entries : Array <
123107 | PredefinedProfile . CustomEntry
124108 | PredefinedProfile . PredefinedEntry
@@ -135,14 +119,6 @@ export interface PredefinedProfile {
135119
136120 ai_context_enabled ?: boolean ;
137121
138- confidence_threshold ?: 'low' | 'medium' | 'high' | 'very_high' ;
139-
140- /**
141- * @deprecated Scan the context of predefined entries to only return matches
142- * surrounded by keywords.
143- */
144- context_awareness ?: ProfilesAPI . ContextAwareness ;
145-
146122 ocr_enabled ?: boolean ;
147123
148124 /**
@@ -282,57 +258,6 @@ export namespace PredefinedProfile {
282258
283259export type PredefinedDeleteResponse = unknown ;
284260
285- export interface PredefinedCreateParams {
286- /**
287- * Path param:
288- */
289- account_id : string ;
290-
291- /**
292- * Body param:
293- */
294- profile_id : string ;
295-
296- /**
297- * Body param:
298- */
299- ai_context_enabled ?: boolean ;
300-
301- /**
302- * Body param:
303- */
304- allowed_match_count ?: number | null ;
305-
306- /**
307- * Body param:
308- */
309- confidence_threshold ?: string | null ;
310-
311- /**
312- * @deprecated Body param: Scan the context of predefined entries to only return
313- * matches surrounded by keywords.
314- */
315- context_awareness ?: ProfilesAPI . ContextAwarenessParam ;
316-
317- /**
318- * @deprecated Body param:
319- */
320- entries ?: Array < PredefinedCreateParams . Entry > ;
321-
322- /**
323- * Body param:
324- */
325- ocr_enabled ?: boolean ;
326- }
327-
328- export namespace PredefinedCreateParams {
329- export interface Entry {
330- id : string ;
331-
332- enabled : boolean ;
333- }
334- }
335-
336261export interface PredefinedUpdateParams {
337262 /**
338263 * Path param:
@@ -355,10 +280,9 @@ export interface PredefinedUpdateParams {
355280 confidence_threshold ?: string | null ;
356281
357282 /**
358- * @deprecated Body param: Scan the context of predefined entries to only return
359- * matches surrounded by keywords.
283+ * Body param:
360284 */
361- context_awareness ?: ProfilesAPI . ContextAwarenessParam ;
285+ enabled_entries ?: Array < string > | null ;
362286
363287 /**
364288 * @deprecated Body param:
@@ -391,7 +315,6 @@ export declare namespace Predefined {
391315 export {
392316 type PredefinedProfile as PredefinedProfile ,
393317 type PredefinedDeleteResponse as PredefinedDeleteResponse ,
394- type PredefinedCreateParams as PredefinedCreateParams ,
395318 type PredefinedUpdateParams as PredefinedUpdateParams ,
396319 type PredefinedDeleteParams as PredefinedDeleteParams ,
397320 type PredefinedGetParams as PredefinedGetParams ,
0 commit comments