Class: OCI::DatabaseMigration::Models::MySqlInitialLoadSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_migration/models/my_sql_initial_load_settings.rb

Overview

Optional dump settings

Constant Summary collapse

PRIMARY_KEY_COMPATIBILITY_ENUM =
[
  PRIMARY_KEY_COMPATIBILITY_NONE = 'NONE'.freeze,
  PRIMARY_KEY_COMPATIBILITY_IGNORE_MISSING_PKS = 'IGNORE_MISSING_PKS'.freeze,
  PRIMARY_KEY_COMPATIBILITY_CREATE_INVISIBLE_PKS = 'CREATE_INVISIBLE_PKS'.freeze,
  PRIMARY_KEY_COMPATIBILITY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
HANDLE_GRANT_ERRORS_ENUM =
[
  HANDLE_GRANT_ERRORS_ABORT = 'ABORT'.freeze,
  HANDLE_GRANT_ERRORS_DROP_ACCOUNT = 'DROP_ACCOUNT'.freeze,
  HANDLE_GRANT_ERRORS_IGNORE = 'IGNORE'.freeze,
  HANDLE_GRANT_ERRORS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
JOB_MODE_ENUM =
[
  JOB_MODE_FULL = 'FULL'.freeze,
  JOB_MODE_SCHEMA = 'SCHEMA'.freeze,
  JOB_MODE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MySqlInitialLoadSettings

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :is_consistent (BOOLEAN)

    The value to assign to the #is_consistent property

  • :is_tz_utc (BOOLEAN)

    The value to assign to the #is_tz_utc property

  • :compatibility (Array<OCI::DatabaseMigration::Models::CompatibilityOption>)

    The value to assign to the #compatibility property

  • :primary_key_compatibility (String)

    The value to assign to the #primary_key_compatibility property

  • :is_ignore_existing_objects (BOOLEAN)

    The value to assign to the #is_ignore_existing_objects property

  • :handle_grant_errors (String)

    The value to assign to the #handle_grant_errors property

  • :job_mode (String)

    The value to assign to the #job_mode property



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 108

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.is_consistent = attributes[:'isConsistent'] unless attributes[:'isConsistent'].nil?
  self.is_consistent = true if is_consistent.nil? && !attributes.key?(:'isConsistent') # rubocop:disable Style/StringLiterals

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

  self.is_consistent = attributes[:'is_consistent'] unless attributes[:'is_consistent'].nil?
  self.is_consistent = true if is_consistent.nil? && !attributes.key?(:'isConsistent') && !attributes.key?(:'is_consistent') # rubocop:disable Style/StringLiterals

  self.is_tz_utc = attributes[:'isTzUtc'] unless attributes[:'isTzUtc'].nil?
  self.is_tz_utc = true if is_tz_utc.nil? && !attributes.key?(:'isTzUtc') # rubocop:disable Style/StringLiterals

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

  self.is_tz_utc = attributes[:'is_tz_utc'] unless attributes[:'is_tz_utc'].nil?
  self.is_tz_utc = true if is_tz_utc.nil? && !attributes.key?(:'isTzUtc') && !attributes.key?(:'is_tz_utc') # rubocop:disable Style/StringLiterals

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

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

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

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

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

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

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

  self.handle_grant_errors = attributes[:'handleGrantErrors'] if attributes[:'handleGrantErrors']

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

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

  self.job_mode = attributes[:'jobMode'] if attributes[:'jobMode']

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

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

Instance Attribute Details

#compatibilityArray<OCI::DatabaseMigration::Models::CompatibilityOption>

Apply the specified requirements for compatibility with MySQL Database Service for all tables in the dump output, altering the dump files as necessary.

Returns:

  • (Array<OCI::DatabaseMigration::Models::CompatibilityOption>)


46
47
48
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 46

def compatibility
  @compatibility
end

#handle_grant_errorsString

The action taken in the event of errors related to GRANT or REVOKE errors.

Returns:

  • (String)


59
60
61
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 59

def handle_grant_errors
  @handle_grant_errors
end

#is_consistentBOOLEAN

Enable (true) or disable (false) consistent data dumps by locking the instance for backup during the dump.

Returns:

  • (BOOLEAN)


35
36
37
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 35

def is_consistent
  @is_consistent
end

#is_ignore_existing_objectsBOOLEAN

Import the dump even if it contains objects that already exist in the target schema in the MySQL instance.

Returns:

  • (BOOLEAN)


55
56
57
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 55

def is_ignore_existing_objects
  @is_ignore_existing_objects
end

#is_tz_utcBOOLEAN

Include a statement at the start of the dump to set the time zone to UTC.

Returns:

  • (BOOLEAN)


40
41
42
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 40

def is_tz_utc
  @is_tz_utc
end

#job_modeString

[Required] MySql Job Mode

Returns:

  • (String)


63
64
65
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 63

def job_mode
  @job_mode
end

#primary_key_compatibilityString

Primary key compatibility option

Returns:

  • (String)


50
51
52
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 50

def primary_key_compatibility
  @primary_key_compatibility
end

Class Method Details

.attribute_mapObject

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



66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 66

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'is_consistent': :'isConsistent',
    'is_tz_utc': :'isTzUtc',
    'compatibility': :'compatibility',
    'primary_key_compatibility': :'primaryKeyCompatibility',
    'is_ignore_existing_objects': :'isIgnoreExistingObjects',
    'handle_grant_errors': :'handleGrantErrors',
    'job_mode': :'jobMode'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 81

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'is_consistent': :'BOOLEAN',
    'is_tz_utc': :'BOOLEAN',
    'compatibility': :'Array<OCI::DatabaseMigration::Models::CompatibilityOption>',
    'primary_key_compatibility': :'String',
    'is_ignore_existing_objects': :'BOOLEAN',
    'handle_grant_errors': :'String',
    'job_mode': :'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



207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 207

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

  self.class == other.class &&
    is_consistent == other.is_consistent &&
    is_tz_utc == other.is_tz_utc &&
    compatibility == other.compatibility &&
    primary_key_compatibility == other.primary_key_compatibility &&
    is_ignore_existing_objects == other.is_ignore_existing_objects &&
    handle_grant_errors == other.handle_grant_errors &&
    job_mode == other.job_mode
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



243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 243

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


223
224
225
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 223

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



232
233
234
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 232

def hash
  [is_consistent, is_tz_utc, compatibility, primary_key_compatibility, is_ignore_existing_objects, handle_grant_errors, job_mode].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



276
277
278
279
280
281
282
283
284
285
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 276

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



270
271
272
# File 'lib/oci/database_migration/models/my_sql_initial_load_settings.rb', line 270

def to_s
  to_hash.to_s
end