Data Loss Prevention V2 Client - Class FieldTransformation (1.8.6)

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

Methods

__construct

Constructor.

Parameters
NameDescription
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
TypeDescription
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
NameDescription
var array<Google\Cloud\Dlp\V2\FieldId>
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var Google\Cloud\Dlp\V2\RecordCondition
Returns
TypeDescription
$this

getPrimitiveTransformation

Apply the transformation to the entire field.

Returns
TypeDescription
Google\Cloud\Dlp\V2\PrimitiveTransformation|null

hasPrimitiveTransformation

setPrimitiveTransformation

Apply the transformation to the entire field.

Parameter
NameDescription
var Google\Cloud\Dlp\V2\PrimitiveTransformation
Returns
TypeDescription
$this

getInfoTypeTransformations

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

Returns
TypeDescription
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
NameDescription
var Google\Cloud\Dlp\V2\InfoTypeTransformations
Returns
TypeDescription
$this

getTransformation

Returns
TypeDescription
string