Skip to main content

io.enterpriseai.resources.DlpClient

Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/DlpClient.java. Back to the Java SDK reference index.

note

This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.

Class DlpClient​

Data loss prevention inspection, redaction and rules.

Constructor DlpClient​

DlpClient(Transport transport)

Creates the client on the shared transport; EnterpriseAIClient builds it and exposes it through the accessor of the same name.

NameTypeDefaultRequiredDescription
transportTransportyesTransport shared by the sub-clients of one client.

DlpClient.createRule​

JsonNode createRule(Object body)

Create or update a DLP rule. Creates the rule, or replaces the rule of the same name. A rule needs an entity_type or a pattern (a valid regular expression); errors answer 400 invalid_request (unknown action, invalid pattern or classification). Needs tenant_admin or security_officer. Writes the audit event dlp.rule.upsert. Answers 201 with the rule.

Route: /v1/dlp/rules (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesName, entity type or pattern, action, classification and score of the rule.

Returns: JsonNode. Decoded JSON answer of the operation "Create or update a DLP rule".

Raises: the typed errors of the transport (Errors).

DlpClient.createRule​

JsonNode createRule(Object body, RequestOptions options)

Create or update a DLP rule. Creates the rule, or replaces the rule of the same name. A rule needs an entity_type or a pattern (a valid regular expression); errors answer 400 invalid_request (unknown action, invalid pattern or classification). Needs tenant_admin or security_officer. Writes the audit event dlp.rule.upsert. Answers 201 with the rule.

Route: /v1/dlp/rules (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesName, entity type or pattern, action, classification and score of the rule.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Create or update a DLP rule".

Raises: the typed errors of the transport (Errors).

DlpClient.inspect​

JsonNode inspect(Object body)

Inspect a text for sensitive data. Runs DLP on the text with the tenant rules, in mode detect unless mode says otherwise. The answer gives text, findings (type, position, score, classification, short preview, action, rule), action (strongest action applied), classification, mode, engine (builtin or presidio), blocked and count. An unknown mode answers 400. Open to any member of the tenant. Writes the audit event dlp.inspect (counts and types only).

Route: /v1/dlp/inspect (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesText, optional mode and language.

Returns: JsonNode. Decoded JSON answer of the operation "Inspect a text for sensitive data".

Raises: the typed errors of the transport (Errors).

DlpClient.inspect​

JsonNode inspect(Object body, RequestOptions options)

Inspect a text for sensitive data. Runs DLP on the text with the tenant rules, in mode detect unless mode says otherwise. The answer gives text, findings (type, position, score, classification, short preview, action, rule), action (strongest action applied), classification, mode, engine (builtin or presidio), blocked and count. An unknown mode answers 400. Open to any member of the tenant. Writes the audit event dlp.inspect (counts and types only).

Route: /v1/dlp/inspect (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesText, optional mode and language.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Inspect a text for sensitive data".

Raises: the typed errors of the transport (Errors).

DlpClient.listRules​

Page<JsonNode> listRules()

List the DLP rules. Lists the DLP rules of the tenant ordered by name. Open to any member of the tenant. next_cursor is always null.

Route: /v1/dlp/rules (GET).

This element takes no parameter.

Returns: Page<JsonNode>. A Page: One page of a cursor paginated collection ({"items": [...], "next_cursor": "..."|null}).

Raises: the typed errors of the transport (Errors).

DlpClient.redact​

JsonNode redact(Object body)

Redact sensitive data from a text. Same as inspect, in mode mask by default: each finding is replaced by [TYPE] (for example [EMAIL]), or tokenized or blocked when a tenant rule or mode says so; a blocked text comes back empty with blocked: true. Open to any member of the tenant. Writes the audit event dlp.redact.

Route: /v1/dlp/redact (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesText, optional mode and language.

Returns: JsonNode. Decoded JSON answer of the operation "Redact sensitive data from a text".

Raises: the typed errors of the transport (Errors).

DlpClient.redact​

JsonNode redact(Object body, RequestOptions options)

Redact sensitive data from a text. Same as inspect, in mode mask by default: each finding is replaced by [TYPE] (for example [EMAIL]), or tokenized or blocked when a tenant rule or mode says so; a blocked text comes back empty with blocked: true. Open to any member of the tenant. Writes the audit event dlp.redact.

Route: /v1/dlp/redact (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesText, optional mode and language.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Redact sensitive data from a text".

Raises: the typed errors of the transport (Errors).