Class: Google::Apis::DlpV2::GooglePrivacyDlpV2PrimitiveTransformation
- Inherits:
-
Object
- Object
- Google::Apis::DlpV2::GooglePrivacyDlpV2PrimitiveTransformation
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/dlp_v2/classes.rb,
lib/google/apis/dlp_v2/representations.rb,
lib/google/apis/dlp_v2/representations.rb
Overview
A rule for transforming a value.
Instance Attribute Summary collapse
-
#bucketing_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2BucketingConfig
Generalization function that buckets values based on ranges.
-
#character_mask_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2CharacterMaskConfig
Partially mask a string by replacing a given number of characters with a fixed character.
-
#crypto_deterministic_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2CryptoDeterministicConfig
Pseudonymization method that generates deterministic encryption for the given input.
-
#crypto_hash_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2CryptoHashConfig
Pseudonymization method that generates surrogates via cryptographic hashing.
-
#crypto_replace_ffx_fpe_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig
Replaces an identifier with a surrogate using Format Preserving Encryption ( FPE) with the FFX mode of operation; however when used in the
ReidentifyContent
API method, it serves the opposite function by reversing the surrogate back into the original identifier. -
#date_shift_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2DateShiftConfig
Shifts dates by random number of days, with option to be consistent for the same context.
-
#fixed_size_bucketing_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2FixedSizeBucketingConfig
Buckets values based on fixed size ranges.
-
#redact_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2RedactConfig
Redact a given value.
-
#replace_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2ReplaceValueConfig
Replace each input value with a given
Value
. -
#replace_dictionary_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2ReplaceDictionaryConfig
Replace each input value with a value randomly selected from the dictionary.
-
#replace_with_info_type_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2ReplaceWithInfoTypeConfig
Replace each matching finding with the name of the info_type.
-
#time_part_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2TimePartConfig
For use with
Date
,Timestamp
, andTimeOfDay
, extract or preserve a portion of the value.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GooglePrivacyDlpV2PrimitiveTransformation
constructor
A new instance of GooglePrivacyDlpV2PrimitiveTransformation.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GooglePrivacyDlpV2PrimitiveTransformation
Returns a new instance of GooglePrivacyDlpV2PrimitiveTransformation.
7338 7339 7340 |
# File 'lib/google/apis/dlp_v2/classes.rb', line 7338 def initialize(**args) update!(**args) end |
Instance Attribute Details
#bucketing_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2BucketingConfig
Generalization function that buckets values based on ranges. The ranges and
replacement values are dynamically provided by the user for custom behavior,
such as 1-30 -> LOW, 31-65 -> MEDIUM, 66-100 -> HIGH. This can be used on data
of type: number, long, string, timestamp. If the bound Value
type differs
from the type of data being transformed, we will first attempt converting the
type of the data to be transformed to match the type of the bound before
comparing. See https://cloud.google.com/sensitive-data-protection/docs/
concepts-bucketing to learn more.
Corresponds to the JSON property bucketingConfig
7245 7246 7247 |
# File 'lib/google/apis/dlp_v2/classes.rb', line 7245 def bucketing_config @bucketing_config end |
#character_mask_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2CharacterMaskConfig
Partially mask a string by replacing a given number of characters with a fixed
character. Masking can start from the beginning or end of the string. This can
be used on data of any type (numbers, longs, and so on) and when de-
identifying structured data we'll attempt to preserve the original data's type.
(This allows you to take a long like 123 and modify it to a string like **3.
Corresponds to the JSON property characterMaskConfig
7254 7255 7256 |
# File 'lib/google/apis/dlp_v2/classes.rb', line 7254 def character_mask_config @character_mask_config end |
#crypto_deterministic_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2CryptoDeterministicConfig
Pseudonymization method that generates deterministic encryption for the given
input. Outputs a base64 encoded representation of the encrypted output. Uses
AES-SIV based on the RFC https://tools.ietf.org/html/rfc5297.
Corresponds to the JSON property cryptoDeterministicConfig
7261 7262 7263 |
# File 'lib/google/apis/dlp_v2/classes.rb', line 7261 def crypto_deterministic_config @crypto_deterministic_config end |
#crypto_hash_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2CryptoHashConfig
Pseudonymization method that generates surrogates via cryptographic hashing.
Uses SHA-256. The key size must be either 32 or 64 bytes. Outputs a base64
encoded representation of the hashed output (for example,
L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=). Currently, only string and
integer values can be hashed. See https://cloud.google.com/sensitive-data-
protection/docs/pseudonymization to learn more.
Corresponds to the JSON property cryptoHashConfig
7271 7272 7273 |
# File 'lib/google/apis/dlp_v2/classes.rb', line 7271 def crypto_hash_config @crypto_hash_config end |
#crypto_replace_ffx_fpe_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig
Replaces an identifier with a surrogate using Format Preserving Encryption (
FPE) with the FFX mode of operation; however when used in the
ReidentifyContent
API method, it serves the opposite function by reversing
the surrogate back into the original identifier. The identifier must be
encoded as ASCII. For a given crypto key and context, the same identifier will
be replaced with the same surrogate. Identifiers must be at least two
characters long. In the case that the identifier is the empty string, it will
be skipped. See https://cloud.google.com/sensitive-data-protection/docs/
pseudonymization to learn more. Note: We recommend using
CryptoDeterministicConfig for all use cases which do not require preserving
the input alphabet space and size, plus warrant referential integrity.
Corresponds to the JSON property cryptoReplaceFfxFpeConfig
7286 7287 7288 |
# File 'lib/google/apis/dlp_v2/classes.rb', line 7286 def crypto_replace_ffx_fpe_config @crypto_replace_ffx_fpe_config end |
#date_shift_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2DateShiftConfig
Shifts dates by random number of days, with option to be consistent for the
same context. See https://cloud.google.com/sensitive-data-protection/docs/
concepts-date-shifting to learn more.
Corresponds to the JSON property dateShiftConfig
7293 7294 7295 |
# File 'lib/google/apis/dlp_v2/classes.rb', line 7293 def date_shift_config @date_shift_config end |
#fixed_size_bucketing_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2FixedSizeBucketingConfig
Buckets values based on fixed size ranges. The Bucketing transformation can
provide all of this functionality, but requires more configuration. This
message is provided as a convenience to the user for simple bucketing
strategies. The transformed value will be a hyphenated string of lower_bound
-
upper_bound
. For example, if lower_bound = 10 and upper_bound = 20, all
values that are within this bucket will be replaced with "10-20". This can be
used on data of type: double, long. If the bound Value type differs from the
type of data being transformed, we will first attempt converting the type of
the data to be transformed to match the type of the bound before comparing.
See https://cloud.google.com/sensitive-data-protection/docs/concepts-bucketing
to learn more.
Corresponds to the JSON property fixedSizeBucketingConfig
7308 7309 7310 |
# File 'lib/google/apis/dlp_v2/classes.rb', line 7308 def fixed_size_bucketing_config @fixed_size_bucketing_config end |
#redact_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2RedactConfig
Redact a given value. For example, if used with an InfoTypeTransformation
transforming PHONE_NUMBER, and input 'My phone number is 206-555-0123', the
output would be 'My phone number is '.
Corresponds to the JSON property redactConfig
7315 7316 7317 |
# File 'lib/google/apis/dlp_v2/classes.rb', line 7315 def redact_config @redact_config end |
#replace_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2ReplaceValueConfig
Replace each input value with a given Value
.
Corresponds to the JSON property replaceConfig
7320 7321 7322 |
# File 'lib/google/apis/dlp_v2/classes.rb', line 7320 def replace_config @replace_config end |
#replace_dictionary_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2ReplaceDictionaryConfig
Replace each input value with a value randomly selected from the dictionary.
Corresponds to the JSON property replaceDictionaryConfig
7325 7326 7327 |
# File 'lib/google/apis/dlp_v2/classes.rb', line 7325 def replace_dictionary_config @replace_dictionary_config end |
#replace_with_info_type_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2ReplaceWithInfoTypeConfig
Replace each matching finding with the name of the info_type.
Corresponds to the JSON property replaceWithInfoTypeConfig
7330 7331 7332 |
# File 'lib/google/apis/dlp_v2/classes.rb', line 7330 def replace_with_info_type_config @replace_with_info_type_config end |
#time_part_config ⇒ Google::Apis::DlpV2::GooglePrivacyDlpV2TimePartConfig
For use with Date
, Timestamp
, and TimeOfDay
, extract or preserve a
portion of the value.
Corresponds to the JSON property timePartConfig
7336 7337 7338 |
# File 'lib/google/apis/dlp_v2/classes.rb', line 7336 def time_part_config @time_part_config end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 |
# File 'lib/google/apis/dlp_v2/classes.rb', line 7343 def update!(**args) @bucketing_config = args[:bucketing_config] if args.key?(:bucketing_config) @character_mask_config = args[:character_mask_config] if args.key?(:character_mask_config) @crypto_deterministic_config = args[:crypto_deterministic_config] if args.key?(:crypto_deterministic_config) @crypto_hash_config = args[:crypto_hash_config] if args.key?(:crypto_hash_config) @crypto_replace_ffx_fpe_config = args[:crypto_replace_ffx_fpe_config] if args.key?(:crypto_replace_ffx_fpe_config) @date_shift_config = args[:date_shift_config] if args.key?(:date_shift_config) @fixed_size_bucketing_config = args[:fixed_size_bucketing_config] if args.key?(:fixed_size_bucketing_config) @redact_config = args[:redact_config] if args.key?(:redact_config) @replace_config = args[:replace_config] if args.key?(:replace_config) @replace_dictionary_config = args[:replace_dictionary_config] if args.key?(:replace_dictionary_config) @replace_with_info_type_config = args[:replace_with_info_type_config] if args.key?(:replace_with_info_type_config) @time_part_config = args[:time_part_config] if args.key?(:time_part_config) end |