Class: OCI::DataSafe::Models::MaskingPolicy

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_safe/models/masking_policy.rb

Overview

A masking policy defines the approach to mask data in a target database. It's basically a collection of columns to be masked, called masking columns, and the associated masking formats to be used to mask these columns. A masking policy can be used to mask multiple databases provided that they have the same schema design. For more information, see <a href="Masking“>docs.oracle.com/en/cloud/paas/data-safe/udscs/masking-policies.html">Masking Policies </a> in the Oracle Data Safe documentation.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_NEEDS_ATTENTION = 'NEEDS_ATTENTION'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
RECOMPILE_ENUM =
[
  RECOMPILE_SERIAL = 'SERIAL'.freeze,
  RECOMPILE_PARALLEL = 'PARALLEL'.freeze,
  RECOMPILE_NONE = 'NONE'.freeze,
  RECOMPILE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MaskingPolicy

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# File 'lib/oci/data_safe/models/masking_policy.rb', line 208

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.id = attributes[:'id'] if attributes[:'id']

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

  raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')

  self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

  raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')

  self.display_name = attributes[:'display_name'] if attributes[:'display_name']

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

  raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')

  self.time_created = attributes[:'time_created'] if attributes[:'time_created']

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

  raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')

  self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

  raise 'You cannot provide both :timeUpdated and :time_updated' if attributes.key?(:'timeUpdated') && attributes.key?(:'time_updated')

  self.time_updated = attributes[:'time_updated'] if attributes[:'time_updated']

  self.description = attributes[:'description'] if attributes[:'description']

  self.is_drop_temp_tables_enabled = attributes[:'isDropTempTablesEnabled'] unless attributes[:'isDropTempTablesEnabled'].nil?

  raise 'You cannot provide both :isDropTempTablesEnabled and :is_drop_temp_tables_enabled' if attributes.key?(:'isDropTempTablesEnabled') && attributes.key?(:'is_drop_temp_tables_enabled')

  self.is_drop_temp_tables_enabled = attributes[:'is_drop_temp_tables_enabled'] unless attributes[:'is_drop_temp_tables_enabled'].nil?

  self.is_redo_logging_enabled = attributes[:'isRedoLoggingEnabled'] unless attributes[:'isRedoLoggingEnabled'].nil?

  raise 'You cannot provide both :isRedoLoggingEnabled and :is_redo_logging_enabled' if attributes.key?(:'isRedoLoggingEnabled') && attributes.key?(:'is_redo_logging_enabled')

  self.is_redo_logging_enabled = attributes[:'is_redo_logging_enabled'] unless attributes[:'is_redo_logging_enabled'].nil?

  self.is_refresh_stats_enabled = attributes[:'isRefreshStatsEnabled'] unless attributes[:'isRefreshStatsEnabled'].nil?

  raise 'You cannot provide both :isRefreshStatsEnabled and :is_refresh_stats_enabled' if attributes.key?(:'isRefreshStatsEnabled') && attributes.key?(:'is_refresh_stats_enabled')

  self.is_refresh_stats_enabled = attributes[:'is_refresh_stats_enabled'] unless attributes[:'is_refresh_stats_enabled'].nil?

  self.parallel_degree = attributes[:'parallelDegree'] if attributes[:'parallelDegree']

  raise 'You cannot provide both :parallelDegree and :parallel_degree' if attributes.key?(:'parallelDegree') && attributes.key?(:'parallel_degree')

  self.parallel_degree = attributes[:'parallel_degree'] if attributes[:'parallel_degree']

  self.recompile = attributes[:'recompile'] if attributes[:'recompile']

  self.pre_masking_script = attributes[:'preMaskingScript'] if attributes[:'preMaskingScript']

  raise 'You cannot provide both :preMaskingScript and :pre_masking_script' if attributes.key?(:'preMaskingScript') && attributes.key?(:'pre_masking_script')

  self.pre_masking_script = attributes[:'pre_masking_script'] if attributes[:'pre_masking_script']

  self.post_masking_script = attributes[:'postMaskingScript'] if attributes[:'postMaskingScript']

  raise 'You cannot provide both :postMaskingScript and :post_masking_script' if attributes.key?(:'postMaskingScript') && attributes.key?(:'post_masking_script')

  self.post_masking_script = attributes[:'post_masking_script'] if attributes[:'post_masking_script']

  self.column_source = attributes[:'columnSource'] if attributes[:'columnSource']

  raise 'You cannot provide both :columnSource and :column_source' if attributes.key?(:'columnSource') && attributes.key?(:'column_source')

  self.column_source = attributes[:'column_source'] if attributes[:'column_source']

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

  raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')

  self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

  raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')

  self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
end

Instance Attribute Details

#column_sourceOCI::DataSafe::Models::ColumnSourceDetails



119
120
121
# File 'lib/oci/data_safe/models/masking_policy.rb', line 119

def column_source
  @column_source
end

#compartment_idString

[Required] The OCID of the compartment that contains the masking policy.

Returns:

  • (String)


42
43
44
# File 'lib/oci/data_safe/models/masking_policy.rb', line 42

def compartment_id
  @compartment_id
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags

Example: {\"Operations\": {\"CostCenter\": \"42\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


133
134
135
# File 'lib/oci/data_safe/models/masking_policy.rb', line 133

def defined_tags
  @defined_tags
end

#descriptionString

The description of the masking policy.

Returns:

  • (String)


64
65
66
# File 'lib/oci/data_safe/models/masking_policy.rb', line 64

def description
  @description
end

#display_nameString

[Required] The display name of the masking policy.

Returns:

  • (String)


46
47
48
# File 'lib/oci/data_safe/models/masking_policy.rb', line 46

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags

Example: {\"Department\": \"Finance\"}

Returns:

  • (Hash<String, String>)


126
127
128
# File 'lib/oci/data_safe/models/masking_policy.rb', line 126

def freeform_tags
  @freeform_tags
end

#idString

[Required] The OCID of the masking policy.

Returns:

  • (String)


38
39
40
# File 'lib/oci/data_safe/models/masking_policy.rb', line 38

def id
  @id
end

#is_drop_temp_tables_enabledBOOLEAN

[Required] Indicates if the temporary tables created during a masking operation should be dropped after masking. It's enabled by default. Set this attribute to false to preserve the temporary tables. Masking creates temporary tables that map the original sensitive data values to mask values. By default, these temporary tables are dropped after masking. But, in some cases, you may want to preserve this information to track how masking changed your data. Note that doing so compromises security. These tables must be dropped before the database is available for unprivileged users.

Returns:

  • (BOOLEAN)


73
74
75
# File 'lib/oci/data_safe/models/masking_policy.rb', line 73

def is_drop_temp_tables_enabled
  @is_drop_temp_tables_enabled
end

#is_redo_logging_enabledBOOLEAN

[Required] Indicates if redo logging is enabled during a masking operation. It's disabled by default. Set this attribute to true to enable redo logging. By default, masking disables redo logging and flashback logging to purge any original unmasked data from logs. However, in certain circumstances when you only want to test masking, rollback changes, and retry masking, you could enable logging and use a flashback database to retrieve the original unmasked data after it has been masked.

Returns:

  • (BOOLEAN)


81
82
83
# File 'lib/oci/data_safe/models/masking_policy.rb', line 81

def is_redo_logging_enabled
  @is_redo_logging_enabled
end

#is_refresh_stats_enabledBOOLEAN

[Required] Indicates if statistics gathering is enabled. It's enabled by default. Set this attribute to false to disable statistics gathering. The masking process gathers statistics on masked database tables after masking completes.

Returns:

  • (BOOLEAN)


87
88
89
# File 'lib/oci/data_safe/models/masking_policy.rb', line 87

def is_refresh_stats_enabled
  @is_refresh_stats_enabled
end

#lifecycle_stateString

[Required] The current state of the masking policy.

Returns:

  • (String)


55
56
57
# File 'lib/oci/data_safe/models/masking_policy.rb', line 55

def lifecycle_state
  @lifecycle_state
end

#parallel_degreeString

[Required] Specifies options to enable parallel execution when running data masking. Allowed values are 'NONE' (no parallelism), 'DEFAULT' (the Oracle Database computes the optimum degree of parallelism) or an integer value to be used as the degree of parallelism. Parallel execution helps effectively use multiple CPUs and improve masking performance. Refer to the Oracle Database parallel execution framework when choosing an explicit degree of parallelism.

Returns:

  • (String)


95
96
97
# File 'lib/oci/data_safe/models/masking_policy.rb', line 95

def parallel_degree
  @parallel_degree
end

#post_masking_scriptString

A post-masking script, which can contain SQL and PL/SQL statements. It's executed after the core masking script generated using the masking policy. It's usually used to perform additional transformation or cleanup work after masking.

Returns:

  • (String)


116
117
118
# File 'lib/oci/data_safe/models/masking_policy.rb', line 116

def post_masking_script
  @post_masking_script
end

#pre_masking_scriptString

A pre-masking script, which can contain SQL and PL/SQL statements. It's executed before the core masking script generated using the masking policy. It's usually used to perform any preparation or prerequisite work before masking data.

Returns:

  • (String)


109
110
111
# File 'lib/oci/data_safe/models/masking_policy.rb', line 109

def pre_masking_script
  @pre_masking_script
end

#recompileString

[Required] Specifies how to recompile invalid objects post data masking. Allowed values are 'SERIAL' (recompile in serial), 'PARALLEL' (recompile in parallel), 'NONE' (do not recompile). If it's set to PARALLEL, the value of parallelDegree attribute is used. Use the built-in UTL_RECOMP package to recompile any remaining invalid objects after masking completes.

Returns:

  • (String)


102
103
104
# File 'lib/oci/data_safe/models/masking_policy.rb', line 102

def recompile
  @recompile
end

#time_createdDateTime

[Required] The date and time the masking policy was created, in the format defined by RFC3339.

Returns:

  • (DateTime)


51
52
53
# File 'lib/oci/data_safe/models/masking_policy.rb', line 51

def time_created
  @time_created
end

#time_updatedDateTime

[Required] The date and time the masking policy was last updated, in the format defined by RFC3339

Returns:

  • (DateTime)


60
61
62
# File 'lib/oci/data_safe/models/masking_policy.rb', line 60

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/oci/data_safe/models/masking_policy.rb', line 136

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'compartment_id': :'compartmentId',
    'display_name': :'displayName',
    'time_created': :'timeCreated',
    'lifecycle_state': :'lifecycleState',
    'time_updated': :'timeUpdated',
    'description': :'description',
    'is_drop_temp_tables_enabled': :'isDropTempTablesEnabled',
    'is_redo_logging_enabled': :'isRedoLoggingEnabled',
    'is_refresh_stats_enabled': :'isRefreshStatsEnabled',
    'parallel_degree': :'parallelDegree',
    'recompile': :'recompile',
    'pre_masking_script': :'preMaskingScript',
    'post_masking_script': :'postMaskingScript',
    'column_source': :'columnSource',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/oci/data_safe/models/masking_policy.rb', line 161

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'compartment_id': :'String',
    'display_name': :'String',
    'time_created': :'DateTime',
    'lifecycle_state': :'String',
    'time_updated': :'DateTime',
    'description': :'String',
    'is_drop_temp_tables_enabled': :'BOOLEAN',
    'is_redo_logging_enabled': :'BOOLEAN',
    'is_refresh_stats_enabled': :'BOOLEAN',
    'parallel_degree': :'String',
    'recompile': :'String',
    'pre_masking_script': :'String',
    'post_masking_script': :'String',
    'column_source': :'OCI::DataSafe::Models::ColumnSourceDetails',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/oci/data_safe/models/masking_policy.rb', line 338

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    id == other.id &&
    compartment_id == other.compartment_id &&
    display_name == other.display_name &&
    time_created == other.time_created &&
    lifecycle_state == other.lifecycle_state &&
    time_updated == other.time_updated &&
    description == other.description &&
    is_drop_temp_tables_enabled == other.is_drop_temp_tables_enabled &&
    is_redo_logging_enabled == other.is_redo_logging_enabled &&
    is_refresh_stats_enabled == other.is_refresh_stats_enabled &&
    parallel_degree == other.parallel_degree &&
    recompile == other.recompile &&
    pre_masking_script == other.pre_masking_script &&
    post_masking_script == other.post_masking_script &&
    column_source == other.column_source &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/oci/data_safe/models/masking_policy.rb', line 384

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


364
365
366
# File 'lib/oci/data_safe/models/masking_policy.rb', line 364

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



373
374
375
# File 'lib/oci/data_safe/models/masking_policy.rb', line 373

def hash
  [id, compartment_id, display_name, time_created, lifecycle_state, time_updated, description, is_drop_temp_tables_enabled, is_redo_logging_enabled, is_refresh_stats_enabled, parallel_degree, recompile, pre_masking_script, post_masking_script, column_source, freeform_tags, defined_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



417
418
419
420
421
422
423
424
425
426
# File 'lib/oci/data_safe/models/masking_policy.rb', line 417

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



411
412
413
# File 'lib/oci/data_safe/models/masking_policy.rb', line 411

def to_s
  to_hash.to_s
end