Class: OCI::DataSafe::Models::DifferenceColumn

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

Overview

A SDM masking policy difference column. It can be one of the following three types: NEW: A new column in the sensitive data model that is not in the masking policy. DELETED: A column that is present in the masking policy but has been deleted from the sensitive data model. MODIFIED: A column that is present in the masking policy as well as the sensitive data model but some of its attributes have been modified.

Constant Summary collapse

DIFFERENCE_TYPE_ENUM =
[
  DIFFERENCE_TYPE_NEW = 'NEW'.freeze,
  DIFFERENCE_TYPE_MODIFIED = 'MODIFIED'.freeze,
  DIFFERENCE_TYPE_DELETED = 'DELETED'.freeze,
  DIFFERENCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
PLANNED_ACTION_ENUM =
[
  PLANNED_ACTION_SYNC = 'SYNC'.freeze,
  PLANNED_ACTION_NO_SYNC = 'NO_SYNC'.freeze,
  PLANNED_ACTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
SYNC_STATUS_ENUM =
[
  SYNC_STATUS_SYNCED = 'SYNCED'.freeze,
  SYNC_STATUS_NOT_SYNCED = 'NOT_SYNCED'.freeze,
  SYNC_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DifferenceColumn

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :key (String)

    The value to assign to the #key property

  • :difference_type (String)

    The value to assign to the #difference_type property

  • :sensitive_columnkey (String)

    The value to assign to the #sensitive_columnkey property

  • :masking_columnkey (String)

    The value to assign to the #masking_columnkey 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

  • :sensitive_type_id (String)

    The value to assign to the #sensitive_type_id property

  • :planned_action (String)

    The value to assign to the #planned_action property

  • :sync_status (String)

    The value to assign to the #sync_status property

  • :time_last_synced (DateTime)

    The value to assign to the #time_last_synced property



144
145
146
147
148
149
150
151
152
153
154
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
# File 'lib/oci/data_safe/models/difference_column.rb', line 144

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

  self.difference_type = attributes[:'differenceType'] if attributes[:'differenceType']

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

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

  self.sensitive_columnkey = attributes[:'sensitiveColumnkey'] if attributes[:'sensitiveColumnkey']

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

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

  self.masking_columnkey = attributes[:'maskingColumnkey'] if attributes[:'maskingColumnkey']

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

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

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

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

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

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

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

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

  self.time_last_synced = attributes[:'timeLastSynced'] if attributes[:'timeLastSynced']

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

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

Instance Attribute Details

#column_nameString

[Required] The name of the difference column.

Returns:

  • (String)


65
66
67
# File 'lib/oci/data_safe/models/difference_column.rb', line 65

def column_name
  @column_name
end

#difference_typeString

[Required] The type of the SDM masking policy difference column. It can be one of the following three types: NEW: A new sensitive column in the sensitive data model that is not in the masking policy. DELETED: A column that is present in the masking policy but has been deleted from the sensitive data model. MODIFIED: A column that is present in the masking policy as well as the sensitive data model but some of its attributes have been modified.

Returns:

  • (String)


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

def difference_type
  @difference_type
end

#keyString

[Required] The unique key that identifies the SDM masking policy difference column.

Returns:

  • (String)


37
38
39
# File 'lib/oci/data_safe/models/difference_column.rb', line 37

def key
  @key
end

#masking_columnkeyString

The unique key that identifies the masking column represented by the SDM masking policy difference column.

Returns:

  • (String)


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

def masking_columnkey
  @masking_columnkey
end

#object_nameString

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

Returns:

  • (String)


61
62
63
# File 'lib/oci/data_safe/models/difference_column.rb', line 61

def object_name
  @object_name
end

#planned_actionString

[Required] Specifies how to process the difference column. It's set to SYNC by default. Use the PatchSdmMaskingPolicyDifferenceColumns operation to update this attribute. You can choose one of the following options: SYNC: To sync the difference column and update the masking policy to reflect the changes. NO_SYNC: To not sync the difference column so that it doesn't change the masking policy. After specifying the planned action, you can use the ApplySdmMaskingPolicyDifference operation to automatically process the difference columns.

Returns:

  • (String)


77
78
79
# File 'lib/oci/data_safe/models/difference_column.rb', line 77

def planned_action
  @planned_action
end

#schema_nameString

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

Returns:

  • (String)


57
58
59
# File 'lib/oci/data_safe/models/difference_column.rb', line 57

def schema_name
  @schema_name
end

#sensitive_columnkeyString

The unique key that identifies the sensitive column represented by the SDM masking policy difference column.

Returns:

  • (String)


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

def sensitive_columnkey
  @sensitive_columnkey
end

#sensitive_type_idString

The OCID of the sensitive type associated with the difference column.

Returns:

  • (String)


69
70
71
# File 'lib/oci/data_safe/models/difference_column.rb', line 69

def sensitive_type_id
  @sensitive_type_id
end

#sync_statusString

[Required] Indicates if the difference column has been processed. Use GetDifferenceColumn operation to track whether the difference column has already been processed and applied to the masking policy.

Returns:

  • (String)


83
84
85
# File 'lib/oci/data_safe/models/difference_column.rb', line 83

def sync_status
  @sync_status
end

#time_last_syncedDateTime

The date and time the SDM masking policy difference column was last synced, in the format defined by RFC3339.

Returns:

  • (DateTime)


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

def time_last_synced
  @time_last_synced
end

Class Method Details

.attribute_mapObject

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



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/oci/data_safe/models/difference_column.rb', line 90

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    'difference_type': :'differenceType',
    'sensitive_columnkey': :'sensitiveColumnkey',
    'masking_columnkey': :'maskingColumnkey',
    'schema_name': :'schemaName',
    'object_name': :'objectName',
    'column_name': :'columnName',
    'sensitive_type_id': :'sensitiveTypeId',
    'planned_action': :'plannedAction',
    'sync_status': :'syncStatus',
    'time_last_synced': :'timeLastSynced'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/oci/data_safe/models/difference_column.rb', line 109

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    'difference_type': :'String',
    'sensitive_columnkey': :'String',
    'masking_columnkey': :'String',
    'schema_name': :'String',
    'object_name': :'String',
    'column_name': :'String',
    'sensitive_type_id': :'String',
    'planned_action': :'String',
    'sync_status': :'String',
    'time_last_synced': :'DateTime'
    # 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



261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/oci/data_safe/models/difference_column.rb', line 261

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

  self.class == other.class &&
    key == other.key &&
    difference_type == other.difference_type &&
    sensitive_columnkey == other.sensitive_columnkey &&
    masking_columnkey == other.masking_columnkey &&
    schema_name == other.schema_name &&
    object_name == other.object_name &&
    column_name == other.column_name &&
    sensitive_type_id == other.sensitive_type_id &&
    planned_action == other.planned_action &&
    sync_status == other.sync_status &&
    time_last_synced == other.time_last_synced
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



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/oci/data_safe/models/difference_column.rb', line 301

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


281
282
283
# File 'lib/oci/data_safe/models/difference_column.rb', line 281

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



290
291
292
# File 'lib/oci/data_safe/models/difference_column.rb', line 290

def hash
  [key, difference_type, sensitive_columnkey, masking_columnkey, schema_name, object_name, column_name, sensitive_type_id, planned_action, sync_status, time_last_synced].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



334
335
336
337
338
339
340
341
342
343
# File 'lib/oci/data_safe/models/difference_column.rb', line 334

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



328
329
330
# File 'lib/oci/data_safe/models/difference_column.rb', line 328

def to_s
  to_hash.to_s
end