Data Loss Prevention V2 Client - Class FieldTransformation (1.15.1)

Reference documentation and code samples for the Data Loss Prevention V2 Client class FieldTransformation.

The transformation to apply to the field.

Generated from protobuf message google.privacy.dlp.v2.FieldTransformation

Namespace

Google \ Cloud \ Dlp \ V2

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ fields array<Google\Cloud\Dlp\V2\FieldId>

Required. Input field(s) to apply the transformation to. When you have columns that reference their position within a list, omit the index from the FieldId. FieldId name matching ignores the index. For example, instead of "contact.nums[0].type", use "contact.nums.type".

↳ condition Google\Cloud\Dlp\V2\RecordCondition

Only apply the transformation if the condition evaluates to true for the given RecordCondition. The conditions are allowed to reference fields that are not used in the actual transformation. Example Use Cases: - Apply a different bucket transformation to an age column if the zip code column for the same record is within a specific range. - Redact a field if the date of birth field is greater than 85.

↳ primitive_transformation Google\Cloud\Dlp\V2\PrimitiveTransformation

Apply the transformation to the entire field.

↳ info_type_transformations Google\Cloud\Dlp\V2\InfoTypeTransformations

Treat the contents of the field as free text, and selectively transform content that matches an InfoType.

getFields

Required. Input field(s) to apply the transformation to.

When you have columns that reference their position within a list, omit the index from the FieldId. FieldId name matching ignores the index. For example, instead of "contact.nums[0].type", use "contact.nums.type".

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setFields

Required. Input field(s) to apply the transformation to.

When you have columns that reference their position within a list, omit the index from the FieldId. FieldId name matching ignores the index. For example, instead of "contact.nums[0].type", use "contact.nums.type".

Parameter
Name Description
var array<Google\Cloud\Dlp\V2\FieldId>
Returns
Type Description
$this

getCondition

Only apply the transformation if the condition evaluates to true for the given RecordCondition. The conditions are allowed to reference fields that are not used in the actual transformation.

Example Use Cases:

  • Apply a different bucket transformation to an age column if the zip code column for the same record is within a specific range.
  • Redact a field if the date of birth field is greater than 85.
Returns
Type Description
Google\Cloud\Dlp\V2\RecordCondition|null

hasCondition

clearCondition

setCondition

Only apply the transformation if the condition evaluates to true for the given RecordCondition. The conditions are allowed to reference fields that are not used in the actual transformation.

Example Use Cases:

  • Apply a different bucket transformation to an age column if the zip code column for the same record is within a specific range.
  • Redact a field if the date of birth field is greater than 85.
Parameter
Name Description
var Google\Cloud\Dlp\V2\RecordCondition
Returns
Type Description
$this

getPrimitiveTransformation

Apply the transformation to the entire field.

Returns
Type Description
Google\Cloud\Dlp\V2\PrimitiveTransformation|null

hasPrimitiveTransformation

setPrimitiveTransformation

Apply the transformation to the entire field.

Parameter
Name Description
var Google\Cloud\Dlp\V2\PrimitiveTransformation
Returns
Type Description
$this

getInfoTypeTransformations

Treat the contents of the field as free text, and selectively transform content that matches an InfoType.

Returns
Type Description
Google\Cloud\Dlp\V2\InfoTypeTransformations|null

hasInfoTypeTransformations

setInfoTypeTransformations

Treat the contents of the field as free text, and selectively transform content that matches an InfoType.

Parameter
Name Description
var Google\Cloud\Dlp\V2\InfoTypeTransformations
Returns
Type Description
$this

getTransformation

Returns
Type Description
string