Class: OCI::DataSafe::Models::CreateSensitiveColumnDetails

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

Overview

Details to create a new sensitive column in a sensitive data model.

Constant Summary collapse

OBJECT_TYPE_ENUM =
[
  OBJECT_TYPE_TABLE = 'TABLE'.freeze,
  OBJECT_TYPE_EDITIONING_VIEW = 'EDITIONING_VIEW'.freeze
].freeze
STATUS_ENUM =
[
  STATUS_VALID = 'VALID'.freeze,
  STATUS_INVALID = 'INVALID'.freeze
].freeze
RELATION_TYPE_ENUM =
[
  RELATION_TYPE_NONE = 'NONE'.freeze,
  RELATION_TYPE_APP_DEFINED = 'APP_DEFINED'.freeze,
  RELATION_TYPE_DB_DEFINED = 'DB_DEFINED'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateSensitiveColumnDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :app_name (String)

    The value to assign to the #app_name property

  • :schema_name (String)

    The value to assign to the #schema_name property

  • :object_name (String)

    The value to assign to the #object_name property

  • :column_name (String)

    The value to assign to the #column_name property

  • :object_type (String)

    The value to assign to the #object_type property

  • :data_type (String)

    The value to assign to the #data_type property

  • :status (String)

    The value to assign to the #status property

  • :sensitive_type_id (String)

    The value to assign to the #sensitive_type_id property

  • :parent_column_keys (Array<String>)

    The value to assign to the #parent_column_keys property

  • :relation_type (String)

    The value to assign to the #relation_type property

  • :app_defined_child_column_keys (Array<String>)

    The value to assign to the #app_defined_child_column_keys property

  • :db_defined_child_column_keys (Array<String>)

    The value to assign to the #db_defined_child_column_keys property



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 155

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

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

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

  self.schema_name = attributes[:'schemaName'] if attributes[:'schemaName']

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

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

  self.object_name = attributes[:'objectName'] if attributes[:'objectName']

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

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

  self.column_name = attributes[:'columnName'] if attributes[:'columnName']

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

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

  self.object_type = attributes[:'objectType'] if attributes[:'objectType']
  self.object_type = "TABLE" if object_type.nil? && !attributes.key?(:'objectType') # rubocop:disable Style/StringLiterals

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

  self.object_type = attributes[:'object_type'] if attributes[:'object_type']
  self.object_type = "TABLE" if object_type.nil? && !attributes.key?(:'objectType') && !attributes.key?(:'object_type') # rubocop:disable Style/StringLiterals

  self.data_type = attributes[:'dataType'] if attributes[:'dataType']

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

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

  self.status = attributes[:'status'] if attributes[:'status']
  self.status = "VALID" if status.nil? && !attributes.key?(:'status') # rubocop:disable Style/StringLiterals

  self.sensitive_type_id = attributes[:'sensitiveTypeId'] if attributes[:'sensitiveTypeId']

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

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

  self.parent_column_keys = attributes[:'parentColumnKeys'] if attributes[:'parentColumnKeys']

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

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

  self.relation_type = attributes[:'relationType'] if attributes[:'relationType']
  self.relation_type = "NONE" if relation_type.nil? && !attributes.key?(:'relationType') # rubocop:disable Style/StringLiterals

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

  self.relation_type = attributes[:'relation_type'] if attributes[:'relation_type']
  self.relation_type = "NONE" if relation_type.nil? && !attributes.key?(:'relationType') && !attributes.key?(:'relation_type') # rubocop:disable Style/StringLiterals

  self.app_defined_child_column_keys = attributes[:'appDefinedChildColumnKeys'] if attributes[:'appDefinedChildColumnKeys']

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

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

  self.db_defined_child_column_keys = attributes[:'dbDefinedChildColumnKeys'] if attributes[:'dbDefinedChildColumnKeys']

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

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

Instance Attribute Details

#app_defined_child_column_keysArray<String>

Unique keys identifying the columns that are application-level (non-dictionary) children of the sensitive column. This attribute can be used to establish relationship between columns in a sensitive data model. Note that the child columns must be added to the sensitive data model before their keys can be specified here. If this attribute is provided, the parentColumnKeys and relationType attributes of the child columns are automatically updated to reflect the relationship.

Returns:

  • (Array<String>)


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

def app_defined_child_column_keys
  @app_defined_child_column_keys
end

#app_nameString

The name of the application associated with the sensitive column. It's useful when the application name is different from the schema name. Otherwise, it can be ignored. If this attribute is not provided, it's automatically populated with the value provided for the schemaName attribute.

Returns:

  • (String)


32
33
34
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 32

def app_name
  @app_name
end

#column_nameString

[Required] The name of the sensitive column.

Returns:

  • (String)


44
45
46
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 44

def column_name
  @column_name
end

#data_typeString

The data type of the sensitive column.

Returns:

  • (String)


52
53
54
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 52

def data_type
  @data_type
end

#db_defined_child_column_keysArray<String>

Unique keys identifying the columns that are database-level (dictionary-defined) children of the sensitive column. This attribute can be used to establish relationship between columns in a sensitive data model. Note that the child columns must be added to the sensitive data model before their keys can be specified here. If this attribute is provided, the parentColumnKeys and relationType attributes of the child columns are automatically updated to reflect the relationship.

Returns:

  • (Array<String>)


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

def db_defined_child_column_keys
  @db_defined_child_column_keys
end

#object_nameString

[Required] The database object that contains the sensitive column.

Returns:

  • (String)


40
41
42
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 40

def object_name
  @object_name
end

#object_typeString

The type of the database object that contains the sensitive column.

Returns:

  • (String)


48
49
50
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 48

def object_type
  @object_type
end

#parent_column_keysArray<String>

Unique keys identifying the columns that are parents of the sensitive column. At present, it accepts only one parent column key. This attribute can be used to establish relationship between columns in a sensitive data model. Note that the parent column must be added to the sensitive data model before its key can be specified here. If this attribute is provided, the appDefinedChildColumnKeys or dbDefinedChildColumnKeys attribute of the parent column is automatically updated to reflect the relationship.

Returns:

  • (Array<String>)


72
73
74
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 72

def parent_column_keys
  @parent_column_keys
end

#relation_typeString

The type of referential relationship the sensitive column has with its parent. NONE indicates that the sensitive column does not have a parent. DB_DEFINED indicates that the relationship is defined in the database dictionary. APP_DEFINED indicates that the relationship is defined at the application level and not in the database dictionary.

Returns:

  • (String)


79
80
81
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 79

def relation_type
  @relation_type
end

#schema_nameString

[Required] The database schema that contains the sensitive column.

Returns:

  • (String)


36
37
38
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 36

def schema_name
  @schema_name
end

#sensitive_type_idString

The OCID of the sensitive type to be associated with the sensitive column.

Returns:

  • (String)


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

def sensitive_type_id
  @sensitive_type_id
end

#statusString

The status of the sensitive column. VALID means the column is considered sensitive. INVALID means the column is not considered sensitive. Tracking invalid columns in a sensitive data model helps ensure that an incremental data discovery job does not identify these columns as sensitive.

Returns:

  • (String)


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

def status
  @status
end

Class Method Details

.attribute_mapObject

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



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 98

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'app_name': :'appName',
    'schema_name': :'schemaName',
    'object_name': :'objectName',
    'column_name': :'columnName',
    'object_type': :'objectType',
    'data_type': :'dataType',
    'status': :'status',
    'sensitive_type_id': :'sensitiveTypeId',
    'parent_column_keys': :'parentColumnKeys',
    'relation_type': :'relationType',
    'app_defined_child_column_keys': :'appDefinedChildColumnKeys',
    'db_defined_child_column_keys': :'dbDefinedChildColumnKeys'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 118

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'app_name': :'String',
    'schema_name': :'String',
    'object_name': :'String',
    'column_name': :'String',
    'object_type': :'String',
    'data_type': :'String',
    'status': :'String',
    'sensitive_type_id': :'String',
    'parent_column_keys': :'Array<String>',
    'relation_type': :'String',
    'app_defined_child_column_keys': :'Array<String>',
    'db_defined_child_column_keys': :'Array<String>'
    # 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



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 266

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

  self.class == other.class &&
    app_name == other.app_name &&
    schema_name == other.schema_name &&
    object_name == other.object_name &&
    column_name == other.column_name &&
    object_type == other.object_type &&
    data_type == other.data_type &&
    status == other.status &&
    sensitive_type_id == other.sensitive_type_id &&
    parent_column_keys == other.parent_column_keys &&
    relation_type == other.relation_type &&
    app_defined_child_column_keys == other.app_defined_child_column_keys &&
    db_defined_child_column_keys == other.db_defined_child_column_keys
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



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 307

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


287
288
289
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 287

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



296
297
298
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 296

def hash
  [app_name, schema_name, object_name, column_name, object_type, data_type, status, sensitive_type_id, parent_column_keys, relation_type, app_defined_child_column_keys, db_defined_child_column_keys].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



340
341
342
343
344
345
346
347
348
349
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 340

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



334
335
336
# File 'lib/oci/data_safe/models/create_sensitive_column_details.rb', line 334

def to_s
  to_hash.to_s
end