Class: OCI::DataSafe::Models::SensitiveDataModel

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

Overview

A sensitive data model is a collection of sensitive columns and their referential relationships. It helps understand the sensitive data landscape, track changes, and efficiently enable security controls such as data masking. It can be managed either manually or by performing sensitive data discovery on a reference target database. [Learn more](docs.oracle.com/en/cloud/paas/data-safe/udscs/sensitive-data-models1.html#GUID-849CA7D2-1809-40DD-B6D7-44E46EFF7EB5).

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_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SensitiveDataModel

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :display_name (String)

    The value to assign to the #display_name property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :target_id (String)

    The value to assign to the #target_id property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :app_suite_name (String)

    The value to assign to the #app_suite_name property

  • :description (String)

    The value to assign to the #description property

  • :schemas_for_discovery (Array<String>)

    The value to assign to the #schemas_for_discovery property

  • :sensitive_type_ids_for_discovery (Array<String>)

    The value to assign to the #sensitive_type_ids_for_discovery property

  • :is_sample_data_collection_enabled (BOOLEAN)

    The value to assign to the #is_sample_data_collection_enabled property

  • :is_app_defined_relation_discovery_enabled (BOOLEAN)

    The value to assign to the #is_app_defined_relation_discovery_enabled property

  • :is_include_all_schemas (BOOLEAN)

    The value to assign to the #is_include_all_schemas property

  • :is_include_all_sensitive_types (BOOLEAN)

    The value to assign to the #is_include_all_sensitive_types property

  • :freeform_tags (Hash<String, String>)

    The value to assign to the #freeform_tags property

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

    The value to assign to the #defined_tags property

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

    The value to assign to the #system_tags property



199
200
201
202
203
204
205
206
207
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
304
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 199

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.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.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.target_id = attributes[:'targetId'] if attributes[:'targetId']

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

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

  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.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.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.app_suite_name = attributes[:'appSuiteName'] if attributes[:'appSuiteName']

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

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

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

  self.schemas_for_discovery = attributes[:'schemasForDiscovery'] if attributes[:'schemasForDiscovery']

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

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

  self.sensitive_type_ids_for_discovery = attributes[:'sensitiveTypeIdsForDiscovery'] if attributes[:'sensitiveTypeIdsForDiscovery']

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

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

  self.is_sample_data_collection_enabled = attributes[:'isSampleDataCollectionEnabled'] unless attributes[:'isSampleDataCollectionEnabled'].nil?

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

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

  self.is_app_defined_relation_discovery_enabled = attributes[:'isAppDefinedRelationDiscoveryEnabled'] unless attributes[:'isAppDefinedRelationDiscoveryEnabled'].nil?

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

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

  self.is_include_all_schemas = attributes[:'isIncludeAllSchemas'] unless attributes[:'isIncludeAllSchemas'].nil?

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

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

  self.is_include_all_sensitive_types = attributes[:'isIncludeAllSensitiveTypes'] unless attributes[:'isIncludeAllSensitiveTypes'].nil?

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

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

  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']

  self.system_tags = attributes[:'systemTags'] if attributes[:'systemTags']

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

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

Instance Attribute Details

#app_suite_nameString

[Required] The application suite name identifying a collection of applications. The default value is GENERIC. It’s useful only if maintaining a sensitive data model for a suite of applications.

Returns:

  • (String)


59
60
61
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 59

def app_suite_name
  @app_suite_name
end

#compartment_idString

[Required] The OCID of the compartment that contains the sensitive data model.

Returns:

  • (String)


35
36
37
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 35

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](docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm)

Example: ‘{"CostCenter": "42"}`

Returns:

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


115
116
117
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 115

def defined_tags
  @defined_tags
end

#descriptionString

The description of the sensitive data model.

Returns:

  • (String)


63
64
65
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 63

def description
  @description
end

#display_nameString

[Required] The display name of the sensitive data model.

Returns:

  • (String)


31
32
33
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 31

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](docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm)

Example: ‘"Finance"`

Returns:

  • (Hash<String, String>)


108
109
110
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 108

def freeform_tags
  @freeform_tags
end

#idString

[Required] The OCID of the sensitive data model.

Returns:

  • (String)


27
28
29
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 27

def id
  @id
end

#is_app_defined_relation_discovery_enabledBOOLEAN

[Required] Indicates if data discovery jobs should identify potential application-level (non-dictionary) referential relationships between columns. Note that data discovery automatically identifies and adds database-level (dictionary-defined) relationships. This option helps identify application-level relationships that are not defined in the database dictionary, which in turn, helps identify additional sensitive columns and preserve referential integrity during data masking. It’s disabled by default and should be used only if there is a need to identify application-level relationships.

Returns:

  • (BOOLEAN)


89
90
91
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 89

def is_app_defined_relation_discovery_enabled
  @is_app_defined_relation_discovery_enabled
end

#is_include_all_schemasBOOLEAN

[Required] Indicates if all the schemas in the associated target database should be scanned by data discovery jobs. If it’s set to true, the schemasForDiscovery attribute is ignored and all schemas are used for data discovery.

Returns:

  • (BOOLEAN)


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

def is_include_all_schemas
  @is_include_all_schemas
end

#is_include_all_sensitive_typesBOOLEAN

[Required] Indicates if all the existing sensitive types should be used by data discovery jobs.If it’s set to true, the sensitiveTypeIdsForDiscovery attribute is ignored and all sensitive types are used for data discovery.

Returns:

  • (BOOLEAN)


101
102
103
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 101

def is_include_all_sensitive_types
  @is_include_all_sensitive_types
end

#is_sample_data_collection_enabledBOOLEAN

[Required] Indicates if data discovery jobs should collect and store sample data values for the discovered columns. Sample data helps review the discovered columns and ensure that they actually contain sensitive data. As it collects original data from the target database, it’s disabled by default and should be used only if it’s acceptable to store sample data in Data Safe’s repository in Oracle Cloud. Note that sample data values are not collected for columns with the following data types: LONG, LOB, RAW, XMLTYPE and BFILE.

Returns:

  • (BOOLEAN)


80
81
82
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 80

def is_sample_data_collection_enabled
  @is_sample_data_collection_enabled
end

#lifecycle_stateString

[Required] The current state of the sensitive data model.

Returns:

  • (String)


53
54
55
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 53

def lifecycle_state
  @lifecycle_state
end

#schemas_for_discoveryArray<String>

The schemas to be scanned by data discovery jobs.

Returns:

  • (Array<String>)


67
68
69
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 67

def schemas_for_discovery
  @schemas_for_discovery
end

#sensitive_type_ids_for_discoveryArray<String>

The OCIDs of the sensitive types to be used by data discovery jobs.

Returns:

  • (Array<String>)


71
72
73
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 71

def sensitive_type_ids_for_discovery
  @sensitive_type_ids_for_discovery
end

#system_tagsHash<String, Hash<String, Object>>

System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: ‘{"free-tier-retained": "true"}`

Returns:

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


121
122
123
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 121

def system_tags
  @system_tags
end

#target_idString

[Required] The OCID of the reference target database associated with the sensitive data model. All operations such as performing data discovery and adding columns manually are done in the context of the associated target database.

Returns:

  • (String)


41
42
43
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 41

def target_id
  @target_id
end

#time_createdDateTime

[Required] The date and time the sensitive data model was created, in the format defined by [RFC3339](tools.ietf.org/html/rfc3339).

Returns:

  • (DateTime)


45
46
47
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 45

def time_created
  @time_created
end

#time_updatedDateTime

[Required] The date and time the sensitive data model was last updated, in the format defined by [RFC3339](tools.ietf.org/html/rfc3339).

Returns:

  • (DateTime)


49
50
51
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 49

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 124

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'display_name': :'displayName',
    'compartment_id': :'compartmentId',
    'target_id': :'targetId',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'lifecycle_state': :'lifecycleState',
    'app_suite_name': :'appSuiteName',
    'description': :'description',
    'schemas_for_discovery': :'schemasForDiscovery',
    'sensitive_type_ids_for_discovery': :'sensitiveTypeIdsForDiscovery',
    'is_sample_data_collection_enabled': :'isSampleDataCollectionEnabled',
    'is_app_defined_relation_discovery_enabled': :'isAppDefinedRelationDiscoveryEnabled',
    'is_include_all_schemas': :'isIncludeAllSchemas',
    'is_include_all_sensitive_types': :'isIncludeAllSensitiveTypes',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    'system_tags': :'systemTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 150

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'display_name': :'String',
    'compartment_id': :'String',
    'target_id': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'lifecycle_state': :'String',
    'app_suite_name': :'String',
    'description': :'String',
    'schemas_for_discovery': :'Array<String>',
    'sensitive_type_ids_for_discovery': :'Array<String>',
    'is_sample_data_collection_enabled': :'BOOLEAN',
    'is_app_defined_relation_discovery_enabled': :'BOOLEAN',
    'is_include_all_schemas': :'BOOLEAN',
    'is_include_all_sensitive_types': :'BOOLEAN',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'system_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



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 326

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

  self.class == other.class &&
    id == other.id &&
    display_name == other.display_name &&
    compartment_id == other.compartment_id &&
    target_id == other.target_id &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    lifecycle_state == other.lifecycle_state &&
    app_suite_name == other.app_suite_name &&
    description == other.description &&
    schemas_for_discovery == other.schemas_for_discovery &&
    sensitive_type_ids_for_discovery == other.sensitive_type_ids_for_discovery &&
    is_sample_data_collection_enabled == other.is_sample_data_collection_enabled &&
    is_app_defined_relation_discovery_enabled == other.is_app_defined_relation_discovery_enabled &&
    is_include_all_schemas == other.is_include_all_schemas &&
    is_include_all_sensitive_types == other.is_include_all_sensitive_types &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    system_tags == other.system_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



373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 373

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


353
354
355
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 353

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



362
363
364
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 362

def hash
  [id, display_name, compartment_id, target_id, time_created, time_updated, lifecycle_state, app_suite_name, description, schemas_for_discovery, sensitive_type_ids_for_discovery, is_sample_data_collection_enabled, is_app_defined_relation_discovery_enabled, is_include_all_schemas, is_include_all_sensitive_types, freeform_tags, defined_tags, system_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



406
407
408
409
410
411
412
413
414
415
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 406

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



400
401
402
# File 'lib/oci/data_safe/models/sensitive_data_model.rb', line 400

def to_s
  to_hash.to_s
end