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 \ V2Methods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ fields |
array<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 |
RecordCondition
Only apply the transformation if the condition evaluates to true for the given |
↳ primitive_transformation |
PrimitiveTransformation
Apply the transformation to the entire field. |
↳ info_type_transformations |
InfoTypeTransformations
Treat the contents of the field as free text, and selectively transform content that matches an |
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<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 |
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 |
RecordCondition
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getPrimitiveTransformation
Apply the transformation to the entire field.
| Returns | |
|---|---|
| Type | Description |
PrimitiveTransformation|null |
|
hasPrimitiveTransformation
setPrimitiveTransformation
Apply the transformation to the entire field.
| Parameter | |
|---|---|
| Name | Description |
var |
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 |
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 |
InfoTypeTransformations
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getTransformation
| Returns | |
|---|---|
| Type | Description |
string |
|