Class: OCI::DataIntegration::Models::SchemaDriftConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_integration/models/schema_drift_config.rb

Overview

The configuration for handling schema drift in a Source or Target operator.

Constant Summary collapse

EXTRA_COLUMN_HANDLING_ENUM =
[
  EXTRA_COLUMN_HANDLING_ALLOW = 'ALLOW'.freeze,
  EXTRA_COLUMN_HANDLING_NULL_FILLUP = 'NULL_FILLUP'.freeze,
  EXTRA_COLUMN_HANDLING_DO_NOT_ALLOW = 'DO_NOT_ALLOW'.freeze,
  EXTRA_COLUMN_HANDLING_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
MISSING_COLUMN_HANDLING_ENUM =
[
  MISSING_COLUMN_HANDLING_ALLOW = 'ALLOW'.freeze,
  MISSING_COLUMN_HANDLING_NULL_SELECT = 'NULL_SELECT'.freeze,
  MISSING_COLUMN_HANDLING_DO_NOT_ALLOW = 'DO_NOT_ALLOW'.freeze,
  MISSING_COLUMN_HANDLING_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
DATA_TYPE_CHANGE_HANDLING_ENUM =
[
  DATA_TYPE_CHANGE_HANDLING_ALLOW = 'ALLOW'.freeze,
  DATA_TYPE_CHANGE_HANDLING_DO_CAST_IF_POSSIBLE = 'DO_CAST_IF_POSSIBLE'.freeze,
  DATA_TYPE_CHANGE_HANDLING_DO_NOT_ALLOW = 'DO_NOT_ALLOW'.freeze,
  DATA_TYPE_CHANGE_HANDLING_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SchemaDriftConfig

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/oci/data_integration/models/schema_drift_config.rb', line 83

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.extra_column_handling = attributes[:'extraColumnHandling'] if attributes[:'extraColumnHandling']
  self.extra_column_handling = "ALLOW" if extra_column_handling.nil? && !attributes.key?(:'extraColumnHandling') # rubocop:disable Style/StringLiterals

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

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

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

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

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

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

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

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

  self.is_validation_warning_if_allowed = attributes[:'isValidationWarningIfAllowed'] unless attributes[:'isValidationWarningIfAllowed'].nil?
  self.is_validation_warning_if_allowed = false if is_validation_warning_if_allowed.nil? && !attributes.key?(:'isValidationWarningIfAllowed') # rubocop:disable Style/StringLiterals

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

  self.is_validation_warning_if_allowed = attributes[:'is_validation_warning_if_allowed'] unless attributes[:'is_validation_warning_if_allowed'].nil?
  self.is_validation_warning_if_allowed = false if is_validation_warning_if_allowed.nil? && !attributes.key?(:'isValidationWarningIfAllowed') && !attributes.key?(:'is_validation_warning_if_allowed') # rubocop:disable Style/StringLiterals
end

Instance Attribute Details

#data_type_change_handlingString

The setting for how to handle columns/fields with changed data types.

Returns:

  • (String)


43
44
45
# File 'lib/oci/data_integration/models/schema_drift_config.rb', line 43

def data_type_change_handling
  @data_type_change_handling
end

#extra_column_handlingString

The setting for how to handle extra columns/fields. NULL_FILLUP means that nulls will be loaded into the target for extra columns.

Returns:

  • (String)


35
36
37
# File 'lib/oci/data_integration/models/schema_drift_config.rb', line 35

def extra_column_handling
  @extra_column_handling
end

#is_validation_warning_if_allowedBOOLEAN

If true, display a validation warning for schema changes, even if they are allowed.

Returns:

  • (BOOLEAN)


47
48
49
# File 'lib/oci/data_integration/models/schema_drift_config.rb', line 47

def is_validation_warning_if_allowed
  @is_validation_warning_if_allowed
end

#missing_column_handlingString

The setting for how to handle missing columns/fields. NULL_SELECT means that null values will be selected from the source for missing columns.

Returns:

  • (String)


39
40
41
# File 'lib/oci/data_integration/models/schema_drift_config.rb', line 39

def missing_column_handling
  @missing_column_handling
end

Class Method Details

.attribute_mapObject

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



50
51
52
53
54
55
56
57
58
59
# File 'lib/oci/data_integration/models/schema_drift_config.rb', line 50

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'extra_column_handling': :'extraColumnHandling',
    'missing_column_handling': :'missingColumnHandling',
    'data_type_change_handling': :'dataTypeChangeHandling',
    'is_validation_warning_if_allowed': :'isValidationWarningIfAllowed'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



62
63
64
65
66
67
68
69
70
71
# File 'lib/oci/data_integration/models/schema_drift_config.rb', line 62

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'extra_column_handling': :'String',
    'missing_column_handling': :'String',
    'data_type_change_handling': :'String',
    'is_validation_warning_if_allowed': :'BOOLEAN'
    # 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



168
169
170
171
172
173
174
175
176
# File 'lib/oci/data_integration/models/schema_drift_config.rb', line 168

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

  self.class == other.class &&
    extra_column_handling == other.extra_column_handling &&
    missing_column_handling == other.missing_column_handling &&
    data_type_change_handling == other.data_type_change_handling &&
    is_validation_warning_if_allowed == other.is_validation_warning_if_allowed
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



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/oci/data_integration/models/schema_drift_config.rb', line 201

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


181
182
183
# File 'lib/oci/data_integration/models/schema_drift_config.rb', line 181

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



190
191
192
# File 'lib/oci/data_integration/models/schema_drift_config.rb', line 190

def hash
  [extra_column_handling, missing_column_handling, data_type_change_handling, is_validation_warning_if_allowed].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



234
235
236
237
238
239
240
241
242
243
# File 'lib/oci/data_integration/models/schema_drift_config.rb', line 234

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



228
229
230
# File 'lib/oci/data_integration/models/schema_drift_config.rb', line 228

def to_s
  to_hash.to_s
end